Size: Integer;
The Size property determines total length of the field.
Executing the example requires that the repository contains a table with the TABLE_S identifier.
Add links to the Dal, Db, and Metabase system assemblies.
Sub UserProc;
Var
MB: IMetabase;
Table: ITable;
Field: ITableField;
Begin
MB := MetabaseClass.Active;
// Get table
Table := MB.ItemById("TABLE_S").Edit As ITable;
// Add a field
Field := Table.Fields.Add;
// Determine settings
Field.DataType := DbDataType.Float;
Field.Id := "NewFloat";
Field.Name := "New real field";
Field.Size := 10;
Field.Precision := 3;
(Table As IMetabaseObject).Save;
End Sub UserProc;
After executing the example, a new real field is created in the table. Field total length is 10 characters, number of decimal digits places is 3.
See also: