Show contents 

Db > Db Assembly Interfaces > ISQLCommand > ISQLCommand.Database

ISQLCommand.Database

Syntax

Database: IDatabase;

Description

The Database property determines a database, in which the DBMS Command object is stored.

Example

Sub UserProc;
Var
    MB: IMetabase;
    CrInfo: IMetabaseObjectCreateInfo;
    MObj: IMetabaseObject;
    SQLCom: ISQLCommand;
Begin
    MB := MetabaseClass.Active;
    CrInfo := MB.CreateCreateInfo;
    CrInfo.ClassID := MetabaseObjectClass.KE_CLASS_SQLCOMMAND;
    CrInfo.Id := "NewSqlCommand";
    CrInfo.Name := "New SQL command";
    CrInfo.Parent := MB.Root;
    MObj := MB.CreateObject(CrInfo).Edit;
    SQLCom := MObj As ISQLCommand;
    SQLCom.Database := MB.ItemById("BD").Bind As IDatabase;
    SQLCom.Text("ORCL") := "Insert Into Table_1(Field1, Field2) Values(12, '12')";
    MObj.Save;
End Sub UserProc;

After executing the example a new DBMS Command is created in repository root. At executing the command one new record is inserted into the Table_1 table.

See also:

ISQLCommand