IDalCommand.Type

Syntax

Type: DalCommandType;

Description

The Type property determines a type of the command to be executed.

Example

Executing the example requires a database with the BD identifier in the repository. There is the Func_1 function that calculates any value on the server on which the database was set.

Sub Main;

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 Main;

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