Type: DalCommandType;
The Type property determines a type of executed command.
Due to existing implementation features when working with Oracle DBMS, the value of the SQL property should be determined before setting value for the Type property.
Executing the example requires that the repository contains a database with the DB identifier. The server, on which the database is configured, contains the Func_1 function that calculates any value.
Add links to the Dal, Db, and Metabase system assemblies.
Sub Main;
Var
MB: IMetabase;
DB: IDatabaseInstance;
Com: IDalCommand;
v: Variant;
Begin
MB := MetabaseClass.Active;
DB := MB.ItemById("DB").Open(Null) As IDatabaseInstance;
Com := DB.Connection.CreateCommand("");
Com.SQL := "Func_1";
Com.Type := DalCommandType.StoredProcedure;
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 function execution result.
See also: