Precision of Numeric Data Types

OLE DB Programmer's Reference

The following OLE DB data types are used to represent numeric values. Each type has a corresponding maximum precision value that indicates the maximum number of base 10 digits that it can store. The radix of the precision for all numeric types is 10.

The maximum precision returned by the provider in the COLUMN_SIZE column of the PROVIDER_TYPES schema rowset is the maximum possible precision for the data type that is supported by the data store. For example, if a data store can support a maximum precision of only 28 for a DBTYPE_NUMERIC column, the provider returns 28, not 39, as the maximum precision.

Note   Only the following data types have a range of scale values:
  • DBTYPE_DECIMAL 0 to 28
  • DBTYPE_NUMERIC 0 to 39
  • DBTYPE_VARNUMERIC -128 to 127

Although generally invalid, the meaning of a precision value of 0 is provider-specific.

Type indicator Maximum precision
DBTYPE_I1 3
DBTYPE_I2 5
DBTYPE_I4 10
DBTYPE_I8 19
DBTYPE_UI1 3
DBTYPE_UI2 5
DBTYPE_UI4 10
DBTYPE_UI8 20
DBTYPE_R4 7
DBTYPE_R8 15
DBTYPE_CY 19
DBTYPE_DECIMAL 29
DBTYPE_NUMERIC 39
DBTYPE_VARNUMERIC 255

1998-2001 Microsoft Corporation. All rights reserved.



Microsoft Ole Db 2.0 Programmer's Reference and Data Access SDK
Microsoft OLE DB 2.0 Programmers Reference and Data Access SDK (Microsoft Professional Editions)
ISBN: 0735605904
EAN: 2147483647
Year: 1998
Pages: 1083

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net