IDtMetabaseProvider.Dataset

Syntax

Dataset: IDatasetModel;

Description

The Dataset property determines repository relational object with which this data provider is connected.

Example

Executing the example requires that the repository contains the ETL task with the ETL identifier and a table with the TABLE_1 identifier.

Sub UserProc;
Var
    MB: IMetabase;
    MObj: IMetabaseObject;
    EtlTask: IEtlTask;
    EtlProvider: IEtlPlainDataProvider;
    MBProvider: IDtMetabaseProvider;
    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 of data source creation
    // Create the Repository Source object
    EtlProvider := EtlTask.Create(EtlObjectType.PlainDataMetabaseProvider) As IEtlPlainDataProvider;
    EtlProvider := EtlProvider.Edit;
    EtlProvider.Id := "MB_Provider";
    EtlProvider.Name := "Repository data source";
    EtlProvider.Description := "Data from the Table_1 table";
    // Set up data source
    MBProvider := EtlProvider.Provider As IDtMetabaseProvider;
    MBProvider.Dataset := MB.ItemById("Table_1").Bind As IDatasetModel;
    EtlProvider.FillDefault;
    // Save data source
    EtlProvider.Save;
    // End of data source creation
    // Start of visual object creation
    WxConsumer := EtlTask.Workspace.CreateRectangle;
    WxETLConsumer := New WxETLObject.Create;
    WxETLConsumer.ETLObject := EtlProvider;
    WxConsumer.Style.TextPosition := WxTextPosition.Bottom;
    WxConsumer.Style.PictureMarginTop := -10;
    WxConsumer.PinPosition := New GxPointF.Create(5050);
    WxConsumer.Extension := WxETLConsumer As IWxShapeExtension;
    // End of visual object creation
    // Save ETL task
    MObj.Save;
End Sub UserProc;

After executing this example the Repository Provider object is created in the ETL task. This data source will be bound with the specified repository table.

See also:

IDtMetabaseProvider