DataDomain: DbDataDomain;
DataDomain: Prognoz.Platform.Interop.Dal.DbDataDomain;
The DataDomain property determines type of table field data if it is used to store multibyte information.
The field can store multibyte information if the DataType property is set to DbDataType.String or DbDataType.Blob. Working with multibyte information is described in the knowledge database in the Working with Fields that have Custom Data Type article.
Also, if the table field has the type - DbDataType.DateTime, by setting the DataDomain property to DbDataDomain.MSec, one can specify whether it is required to store date and time values up to milliseconds.
Executing the example requires that the repository contains a table with the TBL identifier.
Add links to the Dal, Db, Metabase system assemblies.
Sub UserProc;
Var
Mb: IMetabase;
Table: ITable;
Fields: ITableFields;
Field: ITableField;
Begin
MB := MetabaseClass.Active;
Table := MB.ItemById("TBL").Bind As ITable;
Fields := Table.Fields;
For Each Field In Fields Do
If Field.DataType = DbDataType.Blob Then
Select Case Field.DataDomain
Case DbDataDomain.None: Debug.WriteLine("The " + Field.Name + " field stores binary data");
Case DbDataDomain.Memo: Debug.WriteLine("The " + Field.Name + " field stores text data");
Case DbDataDomain.Raw: Debug.WriteLine("The " + Field.Name + " field stores custom data");
End Select;
Elseif Field.DataType = DbDataType.DateTime Then
If Field.DataDomain = DbDataDomain.MSec Then
Debug.WriteLine("The " + Field.Name + " field stores date and time up to milliseconds");
End If;
End If;
End For;
End Sub UserProc;
Imports Prognoz.Platform.Interop.Dal;
Imports Prognoz.Platform.Interop.Db;
Imports Prognoz.Platform.Interop.Metabase;
Public Shared Sub Main(Params: StartParams);
Var
Mb: IMetabase;
Table: ITable;
Fields: ITableFields;
Field: ITableField;
Begin
MB := Params.Metabase;
Table := MB.ItemById["TBL"].Bind() As ITable;
Fields := Table.Fields;
For Each Field In Fields Do
If Field.DataType = DbDataType.ddtBlob Then
Select Case Field.DataDomain
Case DbDataDomain.dddNone: System.Diagnostics.Debug.WriteLine("The " + Field.Name + " field stores binary data");
Case DbDataDomain.dddMemo: System.Diagnostics.Debug.WriteLine("The " + Field.Name + " field stores text data");
Case DbDataDomain.dddRaw: System.Diagnostics.Debug.WriteLine("The " + Field.Name + " field stores custom data");
End Select;
Elseif Field.DataType = DbDataType.ddtDateTime Then
If Field.DataDomain = DbDataDomain.dddMSec Then
System.Diagnostics.Debug.WriteLine("The " + Field.Name + " field stores date and time up to milliseconds");
End If;
End If;
End For;
End Sub;
After executing the example the development environment console displays information about table fields that are used to store multibyte information.
See also: