IRdsDictionary.NonUniqueKeys

Fore Syntax

NonUniqueKeys: IRdsNonUniqueKeys;

Fore.NET Syntax

NonUniqueKeys: Prognoz.Platform.Interop.Rds.IRdsNonUniqueKeys;

Description

The NonUniqueKeys property returns a collection of MDM dictionary non-unique keys.

Comments

Use the IRdsDictionary.UniqueKeys property to get collection of MDM dictionary unique keys.

Fore Example

Executing the example requires the MDM repository with the NSI_1 identifier that contains an MDM dictionary with the DICT_1 identifier.

Add links to the Metabase, Rds, Dal system assemblies.

Sub UserProc;
Var
    MB: IMetabase;
    MObj: IMetabaseObject;
    Dict: IRdsDictionary;
    Attrs: IRdsAttributes;
    Attr: IRdsAttribute;
    Keys: IRdsNonUniqueKeys;
    Key: IRdsNonUniqueKey;
Begin
    MB := MetabaseClass.Active;
    MObj := MB.ItemByIdNamespace("DICT_1", MB.ItemById("NSI_1").Key).Edit;
    Dict := MObj As IRdsDictionary;
    // Create new attribute
    Attrs := Dict.Attributes;
    Keys := Dict.NonUniqueKeys;
    Attr := Attrs.Add;
    Attr.DataType := DbDataType.String;
    Attr.Id := "GosNomer";
    Attr.Name := "State number";
    // Create non-unique key
    Key := Keys.Add;
    Key.Id := "Index_1";
    Key.Name := "Index 1";
    Key.Contains(Attr) := True;
    // Save changes
    (Key.Dictionary As IMetabaseObject).Save;
End Sub UserProc;

After executing the example a custom attribute is created in the MDM dictionary. An MDM dictionary non-unique key is created by this attribute.

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.Rds;

Public Shared Sub Main(Params: StartParams);
Var
    MB: IMetabase;
    MObj: IMetabaseObject;
    Dict: IRdsDictionary;
    Attrs: IRdsAttributes;
    Attr: IRdsAttribute;
    Keys: IRdsNonUniqueKeys;
    Key: IRdsNonUniqueKey;
Begin
    MB := Params.Metabase;
    MObj := MB.ItemByIdNamespace["Dict_1", MB.ItemById["NSI_1"].Key].Edit();
    Dict := MObj As IRdsDictionary;
    // Create new attribute
    Attrs := Dict.Attributes;
    Keys := Dict.NonUniqueKeys;
    Attr := Attrs.Add();
    Attr.DataType := DbDataType.ddtString;
    Attr.Id := "GosNomer";
    Attr.Name := "State number";
    // Create non-unique key
    Key := Keys.Add();
    Key.Id := "Index_1";
    Key.Name := "Index 1";
    Key.Contains[Attr] := True;
    // Save changes
    (Key.Dictionary As IMetabaseObject).Save();
End Sub

See also:

IRdsDictionary