IDtObject.ClearFields

Syntax

ClearFields;

Description

The ClearFields method clears fields list of the data provider or data consumer.

Comments

Fields list is cleared without connecting to data provider or consumer.

Example

Executing the example requires a table with the TBL_SOURCE identifier and an ETL task with the OBJ_ETL_TASK identifier, containing a repository provider with the META_PROVIDER identifier. Add links to the Metabase, Dt, Etl, Db system assemblies.

Sub UserProc;
Var
    MB: IMetabase;
    MObj: IMetabaseObject;
    EtlTask: IEtlTask;
    EtlProvider: IEtlPlainDataProvider;
    MBProvider: IDtMetabaseProvider;
Begin
    MB := MetabaseClass.Active;
    //Get an ETL task
    MObj := MB.ItemById("OBJ_ETL_TASK").Edit;
    EtlTask := MObj As IEtlTask;
    //Get a Repository Source object
    EtlProvider := EtlTask.FindById("META_PROVIDER"As IEtlPlainDataProvider;
    EtlProvider := EtlProvider.Edit;
    //Set up data source
    MBProvider := EtlProvider.Provider As IDtMetabaseProvider;
    MBProvider.Dataset := MB.ItemById("TBL_SOURCE").Bind As IDatasetModel;
    //Fill source fields
    MBProvider.ClearFields;
    EtlProvider.FillFromSource;
    //Save source
    EtlProvider.Save;
    //Save Etl task
    MObj.Save;
End Sub UserProc;

After executing the example repository source is set up to work with the TBL_SOURCE table.

See also:

IDtObject