IEtlPlainLinkFieldMapping.Field

Syntax

Field: IEtlPlainField;

Description

The Field property determines a data source field if type of the link between fields of data consumer and data source is Field.

Example

Sub Main;

Var

MB: IMetabase;

Object: IMetabaseObject;

EtlTask: IEtlTask;

Links: IEtlPlainLinks;

Link: IEtlPlainLink;

Output: IEtlPlainOutput;

Input: IEtlPlainInput;

Field: IEtlPlainField;

FieMapp: IEtlPlainLinkFieldMapping;

i: Integer;

Begin

MB:=MetabaseClass.Active;

Object:=MB.ItemById("ETL").Edit;

EtlTask:=Object As IEtlTask;

Link:=EtlTask.Links.Item(0);

Input:=Link.DestinationObjectInput;

Output:=Link.SourceObjectOutput;

For i:=0 To Input.Fields.Count-1 Do

Field:=Input.Fields.Item(i);

FieMapp:=Link.Link(Field);

FieMapp.Type:=0 As EtlPlainLinkFieldMappingType;

FieMapp.Field:=Output.Fields.Item(Input.Fields.Count-i-1);

End For;

Object.Save;

End Sub Main;

After executing the example inverse link is set between fields of data source output and data consumer input, that is, the first data consumer field is set into correspondence with the last data source field, the second data consumer field with the next to last data source field, and so on.

See also:

IEtlPlainLinkFieldMapping