IDalCommand.Params

Syntax

Params: IDalCommandParams;

Description

The Params property returns parameters of the SQL query.

Example

Executing the example requires a database on the server, on which the BD 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(NullAs 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;

A command that executes the function or procedures stored on the server is created after executing this example. One parameter, in which the result of function execution returns, is created for the command. The result of the Func_1 function execution is contained in the "v" variable after executing this example.

See also:

IDalCommand