使用tStoredPro控件;
begin
Table.Database.StartTransaction;
try
//------调用存储过程1------
with StoredProc do
begin
UnPrepare;
StoredProcName := 'SP1';
Prepare;
//------设置存储过程1的传入参数------
ParamByName('XXX').AsString := XXX;
ParamByName('YYY').AsString := YYY;
ParamByName('ZZZ').AsInteger := ZZZ;
ExecProc;
end;
Table.Database.Commit;
except
Table.Database.Rollback;
MessageDlg('执行存储过程1时发生数据错误。', mtWarning, [mbOK], 0);
Exit;
end;