Active Query Builder support area

MetaDataField Size and Precision the wrong way around ?

Avatar
  • updated
  • Completed

I've had to blink twice for this one having got the CustomExpressionBuilder RelatedField MetaDataField Size and Precision properties return each others data ?

So for a table that shows a field as Numeric (10,2)

I am getting a Size of 2 and a Precision of 10

Avatar

For the numeric(10,2) type the first number is the precision (the max number of decimal digits the type can store) and the second number is scale (the number of decimal digits after the dot). These values can be found in the Precision and Scale properties of the IMetadataField interface.

The Size property is undefined for numeric fields by SQL standard, but database drivers sometimes returns something driver-specific into this property (for example, the number of bytes this type takes on the storage).

Avatar
Andrew Kennard

For me the Numeric(10,2) is being returned as a OLEdtBCD with Size of 2, Precision of 10 and Scale is not a property of MetaDataField ? (in the activex version)


Avatar

I forget to export MetadataField.Scale property to the ActiveX interface. Sorry for inconvenience.

I have added IMetadataField.Scale upstream, and the fix will be included in the next build.