Precision: Integer;
The Precision property returns precision of the cursor field.
This property returns the following values:
Property returns 0 for the string data types.
Property returns the number of digits after the point for the numerical data types with fixed point.
Property returns 0 for the numerical data types with floating point.
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;
Information about precision and size of the table fields is displayed in the console window after executing this example.
See also: