procedure TForm1.RadioButton1Click(Sender: TObject);
begin
with adotable1 do
begin
Active:=false;
Close;
TableName:='sales';
Open;
Active:=true;
end;
s:=0;
end;procedure TForm1.RadioButton2Click(Sender: TObject);
begin
with adotable1 do
begin
Active:=false;
Close;
TableName:='sales2';
Open;
Active:=true;
end;
s:=1;
end;procedure TForm1.Button1Click(Sender: TObject);
var
ret:integer;
begin
i:=0;
with adoquery1 do
begin
close;
sql.Clear;
case s of
0:sql.Add('exec addcttosales');
1:sql.Add('exec addcttosales2');
end;
if i<>j then //判断是否要执行存储过程。
ret:=application.MessageBox('已经计算出季节性系数!','提示',
mb_iconinformation+mb_ok+mb_defbutton1);
else
execsql;
j:=i+1;
Active:=False;
Close;
SQL.Clear;
case s of
0:SQL.Text:='select * from sales';
1:SQL.Text:='select * from sales2';
end;
end;
adotable1.Close;
case s of
0: ADOTable1.TableName:='sales';
1: ADOTable1.TableName:='sales2';
end;
ADOTable1.Open;
adotable1.Active:=true;
怎么改?
因为存储过程执行后,“季节性系数”那列在执行存储过程前值为“NULL”,是否可以通过这个条件来判断不用执行××存储过程?怎么写条件。
begin
with adotable1 do
begin
Active:=false;
Close;
TableName:='sales';
Open;
Active:=true;
end;
s:=0;
end;procedure TForm1.RadioButton2Click(Sender: TObject);
begin
with adotable1 do
begin
Active:=false;
Close;
TableName:='sales2';
Open;
Active:=true;
end;
s:=1;
end;procedure TForm1.Button1Click(Sender: TObject);
var
ret:integer;
begin
i:=0;
with adoquery1 do
begin
close;
sql.Clear;
case s of
0:sql.Add('exec addcttosales');
1:sql.Add('exec addcttosales2');
end;
if i<>j then //判断是否要执行存储过程。
ret:=application.MessageBox('已经计算出季节性系数!','提示',
mb_iconinformation+mb_ok+mb_defbutton1);
else
execsql;
j:=i+1;
Active:=False;
Close;
SQL.Clear;
case s of
0:SQL.Text:='select * from sales';
1:SQL.Text:='select * from sales2';
end;
end;
adotable1.Close;
case s of
0: ADOTable1.TableName:='sales';
1: ADOTable1.TableName:='sales2';
end;
ADOTable1.Open;
adotable1.Active:=true;
怎么改?
因为存储过程执行后,“季节性系数”那列在执行存储过程前值为“NULL”,是否可以通过这个条件来判断不用执行××存储过程?怎么写条件。
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货