with StoreProc do begin Close; Params[0].Value := '你所要传入的参数值'; Params[1].Value := '你所要传入的参数值'; Params[2].Value := ... ... Prepare; ExecProc; end;
用query也可以呀。 exec 过程名 :参数1,:参数2
同意amiao(海燕)的 因为我一直都是这么用的
amiao(海燕) 的用法和我的一样
with query1 do begin sql.Text:='Ins_Pro_D :Y :M :C :D'; ParambyName('Y').Asstring:=edtY.Text; ParambyName('M').Asstring:=edtM.Text; ParambyName('C').Asstring:=edtC.Text; ParambyName('D').AsInteger:=StrToInt(edtD.Text); ExecSql; end;
begin
Close;
Params[0].Value := '你所要传入的参数值';
Params[1].Value := '你所要传入的参数值';
Params[2].Value := ...
...
Prepare;
ExecProc;
end;
exec 过程名 :参数1,:参数2
因为我一直都是这么用的
begin
sql.Text:='Ins_Pro_D :Y :M :C :D';
ParambyName('Y').Asstring:=edtY.Text;
ParambyName('M').Asstring:=edtM.Text;
ParambyName('C').Asstring:=edtC.Text;
ParambyName('D').AsInteger:=StrToInt(edtD.Text);
ExecSql;
end;