IDtSqlCommandConsumer.Command

Syntax

Command: ISQLCommand;

Description

The Command property determines repository DBMS command that processes exporting data.

Example

Executing the example requires that the repository contains an ETL task with the Etl identifier, and a DBMS command with the SQL_Command identifier that processes exporting data.

Sub Main;

Var

MB: IMetabase;

MObj: IMetabaseObject;

EtlTask: IEtlTask;

EtlConsumer: IEtlPlainDataConsumer;

SQLComConsumer: IDtSqlCommandConsumer;

WxConsumer: IWxRectangle;

WxETLConsumer: IWxETLObject;

Begin

MB := MetabaseClass.Active;

//ETL task search. Repository object with the ETL identifier

MObj := MB.ItemById("Etl").Edit;

EtlTask := MObj As IEtlTask;

//Start consumer creation

//Object DBMS Command creation

EtlConsumer := EtlTask.Create(EtlObjectType.PlainDataSqlCommandConsumer) As IEtlPlainDataConsumer;

EtlConsumer := EtlConsumer.Edit;

EtlConsumer.Id := "SQLCom_Consumer";

EtlConsumer.Name := "DBMS command";

EtlConsumer.Description := "DBMS command";

//Set up data consumer

SQLComConsumer := EtlConsumer.Consumer As IDtSqlCommandConsumer;

SQLComConsumer.Command := MB.ItemById("SQL_Command").Bind As ISQLCommand;

EtlConsumer.FillDefault;

//Save consumer

EtlConsumer.Save;

//End of consumer creation

//Start of visual object creation

WxConsumer := EtlTask.Workspace.CreateRectangle;

WxETLConsumer := New WxETLObject.Create;

WxETLConsumer.ETLObject := EtlConsumer;

WxConsumer.Style.TextPosition := WxTextPosition.Bottom;

WxConsumer.Style.PictureMarginTop := -10;

WxConsumer.PinPosition := New GxPointF.Create(50, 50);

WxConsumer.Extension := WxETLConsumer As IWxShapeExtension;

//End of visual object creation

//Save Etl task

MObj.Save;

End Sub Main;

After executing the example the DBMS Command object is created in the ETL task. The consumer exports data using DBMS command of the SQL_Command repository.

See also:

IDtSqlCommandConsumer