IDalCommand.Type

Syntax

Type: DalCommandType;

Description

The Type property determines a type of executed command.

Example

Executing the example requires that the repository contains a database with the BD identifier. The server, on which the database is configured, contains the Func_1 function that calculates any value.

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;

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 returns, is created for the command. After executing the command the "v" variable contains the Func_1 function execution result.

See also:

IDalCommand