IEtlPlainLinkFieldMapping.Field

Syntax

Field: IEtlPlainField;

Description

The Field property determines data source filed if type of the connection between fields of consumer and 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 this example inverse connection is set between fields of source output and consumer input, that is the first consumer field is set into correspondence with the last source field, the second consumer field - with the next to last source field, and so on.

See also:

IEtlPlainLinkFieldMapping