ICubeMetaCopierBinding.DestinationAttributeKey

Syntax

DestinationAttributeKey: Integer;

Description

The DestinationAttributeKey property determines a key for the attribute of consumer database.

Comments

The following methods can be used to bind attributes of the consumer database to attributes of the source database:

If only the attributes identifiers are used for binding, errors may appear on export or import if attribute identifier in any of the databases has been changed. It is safer to bind attributes using their keys.

Example

Executing the example requires a time series database with the OBJ_RUBRICATOR identifier. This time series database must contain an object of time series import with the OBJ_IMPORTREQUEST identifier that imports data from the time series database. Also add links to the Cubes, Metabase and Rds system assemblies.

    Sub UserProc;
    Var
        Mb: IMetabase;
        RubDesc: IMetabaseObjectDescriptor;
        Obj: IMetabaseObject;
        ImportRequestDef: IImportRequestDefinition;
        ImportRequestRubricatorParams: IImportRequestRubricatorParams;
        Rubr: IRubricator;
        FactsDict: IMetaDictionary;
        Attr: IMetaAttribute;
        Binds: ICubeMetaCopierBindings;
        Binding: ICubeMetaCopierBinding;
        i: Integer;
    Begin
        Mb := MetabaseClass.Active;
        RubDesc := Mb.ItemById("OBJ_RUBRICATOR");
        Obj := Mb.ItemByIdNamespace("OBJ_IMPORTREQUEST", RubDesc.Key).Edit;
    // Parameters import
        ImportRequestDef := Obj As IImportRequestDefinition;
        ImportRequestRubricatorParams := ImportRequestDef.RubricatorParams;
        Binds := ImportRequestRubricatorParams.Bindings;
        Rubr := RubDesc.Bind As IRubricator;
        FactsDict := Rubr.Facts;
        For i := 0 To Binds.Count - 1 Do
            Binding := Binds.Item(i);
            If Binding.BindingType = CubeMetaCopierBindingType.Attribute Then
                Attr := FactsDict.Attributes.FindById(Binding.DestinationAttribute);
                Binding.DestinationAttributeKey := Attr.Key;
                Attr := FactsDict.Attributes.FindById(Binding.SourceAttribute);
                Binding.SourceAttributeKey := Attr.Key;
            End If;
        End For;
        Obj.Save;
    End Sub UserProc;

After executing the example import object is reconfigured: attributes are bound by keys and identifiers.

See also:

ICubeMetaCopierBinding