ICubeMetaLoaderBinding.StringPositionStart

Syntax

StringPositionStart: Integer;

Description

The StringPositionStart property determines the start position of the field border where a composite attribute is contained. Values should be set starting with zero. If border is not determined, -1 value should be set.

NOTE. The property is outdated, use ICubeMetaLoaderBindingParser.StringPositionStart.

Example

Executing the example requires a time series database with the OBJ_RUBRICATOR identifier and the time series export file C:\result_exp.txt.

Sub Main;

Var

MB: IMetabase;

CrInfo: IMetabaseObjectCreateInfo;

Obj: IMetabaseObject;

ObjDesc: IMetabaseObjectDescriptor;

Loader: ICubeMetaLoader;

Bindings: ICubeMetaLoaderBindings;

Binding: ICubeMetaLoaderBinding;

TextProvider: IDtTextProvider;

Begin

MB := MetabaseClass.Active;

CrInfo := Mb.CreateCreateInfo;

CrInfo.ClassId := MetabaseObjectClass.KE_CLASS_CUBEMETALOADER;

CrInfo.Parent := Mb.ItemById("OBJ_RUBRICATOR").Bind;

CrInfo.Id := Mb.GenerateId("CUBEMETALOADER", CrInfo.Parent.Key);

CrInfo.Permanent := False;

ObjDesc := Mb.CreateObject(CrInfo);

Obj := ObjDesc.Edit;

Loader := Obj As ICubeMetaLoader;

 

// Data source for import from text format

TextProvider := New DtTextProvider.Create;

TextProvider.File := "C:\result_exp.txt";

TextProvider.FormatType := DtTextFormatType.Delimited;

TextProvider.DelimitedColumnDelimiter := ";";

TextProvider.DelimitedTextQualifier := """";

TextProvider.Encoding := "WIN";

TextProvider.RangeHasHeader := True;

TextProvider.Open;

Loader.Data := (TextProvider As IDatasetDataProvider);

Loader.ImportObjectKey := Obj.Key;

Loader.NewRevisionName := Metaimport;

Loader.LoadType := CubeMetaLoaderLoadType.CreateAndUpdate;

Loader.Rubricator := Mb.ItemById("OBJ_RUBRICATOR").Bind As IRubricator;

Bindings := Loader.Bindings;

Binding := Bindings.Add;

Binding.BindingType := CubeMetaLoaderBindingType.Attribute;

Binding.Attribute := "COUNTRY";

Binding.FieldType := CubeMetaLoaderFieldType.Name;

Binding.Field := "Country_Ind";

Binding.StringPositionStart := 0;

Binding.StringPositionEnd := 2;

Binding := Bindings.Add;

Binding.BindingType := CubeMetaLoaderBindingType.Attribute;

Binding.Attribute := "INDICATOR";

Binding.FieldType := CubeMetaLoaderFieldType.Name;

Binding.Field := "Country_Ind";

Binding.StringPositionStart := 4;

Binding.StringPositionEnd := -1;

End Sub Main;

After executing the example an object of time series import from the text file C:\result_exp.txt is created. A binding with the composite attribute import is set in this object.

See also:

ICubeMetaLoaderBinding