IDatasetModelField.DataDomain

Syntax

DataDomain: DbDataDomain;

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

Description

The DataDomain property determines the data type of data source field, if it is intended for storage of multibyte information.

Comments

The field can store multibyte information if the DataType property is set to DbDataType.String or DbDataType.Blob.

Also, if the table field has the type - DbDataType.DateTime and the field can store date and time up to milliseconds, the DataDomain property returns DbDataDomain.MSec.

Example

Executing the example requires that the repository contains a table with the TBL identifier.

Sub UserProc;
Var
    MB: IMetabase;
    DSInst: IDatasetInstance;
    DSModel: IDatasetModel;
    Fields: IDatasetModelFields;
    Field: IDatasetModelField;
Begin
    MB := MetabaseClass.Active;
    DSInst := MB.ItemById(
"TBL").Open(NullAs IDatasetInstance;
    DSModel := DSInst.Dataset;
    Fields := DSModel.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;
    DSInst: IDatasetInstance;
    DSModel: IDatasetModel;
    Fields: IDatasetModelFields;
    Field: IDatasetModelField;
Begin
    MB := Params.Metabase;
    DSInst := MB.ItemById[
"TBL"].Open(NullAs IDatasetInstance;
    DSModel := DSInst.Dataset;
    Fields := DSModel.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 console window displays the information on table fields that are used to store multibyte information.

See also:

IDatasetModelField