Params: IDalCommandParams;
The Params property returns SQL query parameters.
Executing the example requires a database at the server, on which the database repository database is configured, and the Func_1 function that calculates any value.
Add links to the Metabase, Db, Dal system assemblies.
Sub UserProc;
Var
MB: IMetabase;
DB: IDatabaseInstance;
Com: IDalCommand;
v: Variant;
Begin
MB := MetabaseClass.Active;
DB := MB.ItemById("BD").Open(Null) As IDatabaseInstance;
Com := DB.Connection.CreateCommand("");
Com.Type := DalCommandType.StoredProcedure;
Com.SQL := "Func_1";
Com.Params.Add("Param").Direction := DalParamDirection.ReturnValue;
Com.Execute;
v := Com.Params.Item(0).Value;
Com.Close;
End Sub UserProc;
After executing the example a command that executes the functions or procedures stored at the server is created. One parameter, in which the result of function execution is returned, is created for the command. After executing the command the "v" variable contains the Func_1 function execution result.
See also: