Size: Integer;
The Size property returns the size of the cursor field.
The property returns the following values:
The property returns string size in symbols if it is possible or in bytes for string data types.
The property returns the common number of decimal places for numeric data types with fixed point.
The property returns the common number of decimal places for numeric data types with floating point.
The property returns 0 for the Blob fields.
Sub UserProc;
Var
MB: IMetabase;
DB: IDatabaseInstance;
sql : string;
Com: IDalCommand;
Cur: IDalCursor;
Field: IDalCursorField;
i: Integer;
Begin
MB := MetabaseClass.Active;
DB := MB.ItemById("BD").Open(Null) As IDatabaseInstance;
sql := "Select * From Table_1";
Com := DB.Connection.CreateCommand(sql);
Cur := Com.DescribeCursor;
For i:=0 To Cur.Fields.Count-1 Do
Field := Cur.Fields.Item(i);
Debug.WriteLine("--------------------------------------------");
Debug.WriteLine("Field : "+ Field.Name);
Debug.WriteLine("Size : "+ Field.Size.ToString);
Debug.WriteLine("Precision : "+ Field.Precision.ToString);
Debug.WriteLine("--------------------------------------------");
End For;
Cur.Close;
Com.Close;
End Sub UserProc;
After executing the example the console window displays information about precision and size of table fields.
See also: