IDimAttributeInstance.DataDomain

Fore Syntax

DataDomain: DbDataDomain;

Fore.NET Syntax

DataDomain: Prognoz.Platform.Interop.Dal.DbDataDomain;

Description

The DataDomain property returns data type to store multibyte information in attribute.

Comments

If the DataDomain property is set to DbDataDomain.Memo and the IDimAttribute.DataType property is set to DbDataType.String, the attribute type is Long Text.

On working with the Long Text attribute keep in mind the following constraints:

DataDomain can be set to DbDataDomain.Memo or DbDataDomain.None for table MDM dictionaries and composite table MDM dictionaries.

Fore Example

Executing the example requires that repository contains table MDM dictionary with the TMDMDICT_MEMOTMDMDICT_MEMO identifier. The dictionary should contain several values.

To execute the example, add links to the Dal, Dimensions, Metabase system assemblies.

Sub UserProc;
Var
    mb: IMetabase;
    dimension: IDimInstance;
    attribute: IDimAttributeInstance;
    attributes: IDimAttributesInstance;
    i: Integer;
Begin
    // Get current repository
    mb := MetabaseClass.Active;
    // Get table MDM dictionary
    dimension := mb.ItemById("TMDMDICT_MEMO").Open(NullAs IDimInstance;
    // Get dictionary attributes
    attributes := dimension.Attributes;
    // Parse obtained attributes
    For i := 0 To attributes.Count - 1 Do
        attribute := attributes.Item(i);
        // If attribute is of the Long Text type, display its value
        If (attribute.DataDomain = DbDataDomain.Memo) And
            (attribute.Attribute.DataType = DbDataType.String) Then
            Debug.WriteLine("Value of the first element: " + attribute.Value(0));
        End If;
    End For;
End Sub UserProc;

After executing the example for the first dictionary element, the console displays value of the Long Text attribute type, if it exists in the MDM dictionary.

Fore.NET Example

The requirements and result of the Fore.NET example execution match with those in the Fore Example.

Imports Prognoz.Platform.Interop.Dal;
Imports Prognoz.Platform.Interop.Dimensions;

Public Shared Sub Main(Params: StartParams);
Var
    mb: IMetabase;
    dimension: IDimInstance;
    attribute: IDimAttributeInstance;
    attributes: IDimAttributesInstance;
    i: Integer;
Begin
    // Get current repository
    mb := Params.Metabase;
    // Get table MDM dictionary
    dimension := mb.ItemById["TMDMDICT_MEMO"].Open(NullAs IDimInstance;
    // Get dictionary attributes
    attributes := dimension.Attributes;
    // Parse obtained attributes
    For i := 0 To attributes.Count - 1 Do
        attribute := attributes.Item[i];
        // If attribute is of the Long Text type, display its value
        If (attribute.DataDomain = DbDataDomain.dddMemo) And
            (attribute.Attribute.DataType = DbDataType.ddtString) Then
            System.Diagnostics.Debug.WriteLine("Value of the first element: " + attribute.Value[0]);
        End If;
    End For;
End Sub;

See also:

IDimAttributeInstance