IMetaAttributes.CreateTable

Syntax

CreateTable([BuildFields: Boolean = True; ][Recursive: Boolean = True]);

Parameters

BuildFields - parameter that determines whether it is necessary to create fields in a table. Optional parameter. Default value is True - fields are created in a table.

Recursive - parameter determines whether child elements are allowed in a table. Optional parameter. Default value is True - child elements are allowed.

Description

The CreateTable method creates a system table to store multiple values of time series database attributes.

Example

Executing the example requires that the repository contains a time series database with the OBJ_FC identifier and an MDM repository with the RDS_REPO identifier. The MDM repository must contain a dictionary with the DICT_COUNTRY identifier.

Sub Main;

Var

MB: IMetabase;

Rubr: IRubricator;

Facts: IMetabaseObject;

Att: IMetaAttribute;

CollectionAtt: IMetaAttributes;

Begin

MB := MetabaseClass.Active;

Rubr := MB.ItemById("OBJ_FC").Bind As IRubricator;

Facts := (Rubr.Facts As IMetabaseObject).Edit;

Att := (Facts As IMetaDictionary).Attributes.Add;

Att.DataType := DbDataType.Integer;

Att.Id := "A_M_REF";

Att.Name := New attribute;

Att.Kind := (MetaAttributeKind.Collection) Or (MetaAttributeKind.Dimension);

Att.ValuesObject := MB.ItemByIdNamespace("DICT_COUNTRY", Mb.ItemById("RDS_REPO").Key);

Att.DataType := DbDataType.Integer;

Att.HasMultipleValues := True;

CollectionAtt := Att.CollectionAttributes;

CollectionAtt.BuildCollectionAttributes;

CollectionAtt.CreateTable(True);

Facts.Save;

End Sub Main;

After executing the example, an attribute named New Attribute is added to the dictionary that contains information about database time series with the OBJ_FC identifier. This attribute is a link to the dictionary and supports multiple values. A system table is also created to store multiple values.

See also:

IMetaAttributes