|
AnyDAC
|
Executes the specified stored procedure in the DBMS session.
|
Parameters |
Description |
|
const AProcName: String |
A stored procedure name. |
The number of updated rows, if any.
Call ExecProc to execute a stored procedure in the DBMS session, specified in AProcName or is currently assigned to the StoredProcName property, if AProcName is empty. Use ExecProc to execute stored procedures, that do not return a cursor to data and does not have parameters.
Before calling ExecProc, assing stored procedure additional name parts to the CatalogName, SchemaName, PackageName properties. As part of the ExecProc call the SQL statement calling the stored procedure is built. AProcName may include overload number specified after ';'.
Use ResourceOptions.CmdExecMode to control asynchronous execution mode. And ResourceOptions.CmdExecTimeout to set maximum stored procedure execution time. After that time stored procedure execution will be canceled and exception raised.
To cancel stored procedure execution use TADAdaptedDataSet.AbortJob.
Before stored procedure execution the BeforeExecute event is fired. If server will return stored procedure execution error, then AnyDAC raises an exception. It may be analyzed in OnError event. After stored procedure execution is finished, AfterExecute event is fired.
function ExecProc(const AProcName: String): LongInt; overload;
ADStoredProc1.ExecProc('myproc');|
What do you think about this topic? Send feedback!
|