DataDomain: DbDataDomain;
DataDomain: Prognoz.Platform.Interop.Dal.DbDataDomain;
The DataDomain property determines data type used to store multibyte information in attribute.
For attribute of the Long Text type, this property must be set to DbDataDomain.Memo, an the IMetaAttribute.DataType property must be set to DbDataType.String.
Consider the following constraints on working with the Long Text attribute:
If Oracle DBMS or Teradata is used, it is not available to search for time series by this attribute value.
These attributes cannot be included into a unique index for time series database.
These attributes cannot be mandatory.
These attributes may be sampled and saved slower than standard text attributes.
Executing the example requires that the repository contains a time series database with the TSDB_MEMO identifier not containing a time series attribute with the A_COMMENT identifier.
Add links to the Cubes, Dal, Metabase, Rds system assemblies.
Sub UserProc;
Var
MB: IMetabase;
TSDB: IRubricator;
Facts: IMetabaseObject;
Atts: IMetaAttributes;
Att: IMetaAttribute;
Begin
// Get current repository
MB := MetabaseClass.Active;
// Get time series database
TSDB := MB.ItemById("TSDB_MEMO").Bind As IRubricator;
// Get time series dictionary
Facts := (TSDB.Facts As IMetabaseObject).Edit;
// Get time series attributes
Atts := (Facts As IMetaDictionary).Attributes;
// Add attribute
Att := Atts.Add;
// Set attribute identifier and name
Att.Id := "A_COMMENT";
Att.Name := "Comment";
// Specify attribute key: long text
Att.Kind := MetaAttributeKind.Common;
Att.DataType := DbDataType.String;
Att.DataDomain := DbDataDomain.Memo;
// Specify that attribute is visible, can have
// zero values and does not contain multiple values
Att.Hidden := False;
Att.Nullable := True;
Att.HasMultipleValues := False;
// Save changes
Facts.Save;
End Sub UserProc;
After executing the example a new time series attribute of the Long Text type is added to time series database.
The requirements and result of the Fore.NET Example execution match with those in the Fore Example.
Imports Prognoz.Platform.Interop.Cubes;
Imports Prognoz.Platform.Interop.Dal;
Imports Prognoz.Platform.Interop.Rds;
…
Public Shared Sub Main(Params: StartParams);
Var
MB: IMetabase;
TSDB: IRubricator;
Facts: IMetabaseObject;
Atts: IMetaAttributes;
Att: IMetaAttribute;
Begin
// Get current repository
MB := Params.Metabase;
// Get time series database
TSDB := MB.ItemById["TSDB_MEMO"].Bind() As IRubricator;
// Get time series dictionary
Facts := (TSDB.Facts As IMetabaseObject).Edit();
// Get time series attributes
Atts := (Facts As IMetaDictionary).Attributes;
// Add attribute
Att := Atts.Add(True);
// Set attribute identifier and name
Att.Id := "A_COMMENT";
Att.Name := "Comment";
// Specify attribute key: long text
Att.Kind := MetaAttributeKind.meakCommon;
Att.DataType := DbDataType.ddtString;
Att.DataDomain := DbDataDomain.dddMemo;
// Specify that attribute is visible, can have
// zero values and does not contain multiple values
Att.Hidden := False;
Att.Nullable := True;
Att.HasMultipleValues := False;
// Save changes
Facts.Save();
End Sub;
See also: