Udostępnij za pośrednictwem


Conversions Involving DBTYPE_NUMERIC or DBTYPE_DECIMAL

When retrieving data from a DBTYPE_NUMERIC or DBTYPE_DECIMAL structure, the provider uses the maximum precision and scale stored in that structure. When storing data in a DBTYPE_NUMERIC or DBTYPE_DECIMAL structure, the provider uses the maximum precision and scale in the metadata for that structure. For consumer structures, these are in the binding structure. For provider structures, these are in the DBCOLUMNINFO structure returned by IColumnsInfo::GetColumnInfo or the DBPARAMINFO structure returned by ICommandWithParameters::GetParameterInfo.

The following table shows the maximum precision and scale used by the provider when accessing data in a DBTYPE_NUMERIC or DBTYPE_DECIMAL structure in the consumer's buffer.

Consumer structure

Getting or

setting data

Maximum precision

Scale

DBTYPE_NUMERIC

getting

precision element of DBTYPE_NUMERIC structure

scale element of DBTYPE_NUMERIC structure

DBTYPE_NUMERIC

setting

bPrecision element of DBBINDING structure

bScale element of DBBINDING structure

DBTYPE_VARNUMERIC

getting

precision element of DB_VARNUMERIC structure

scale element of DB_VARNUMERIC structure

DBTYPE_VARNUMERIC

setting

bPrecision element of DBBINDING structure

bScale element of DBBINDING structure

DBTYPE_DECIMAL

getting

29

scale element of DBTYPE_DECIMAL structure

DBTYPE_DECIMAL

setting

29

bScale element of DBBINDING structure

The following table shows the maximum precision and scale used by the provider when accessing data in a DBTYPE_NUMERIC or DBTYPE_DECIMAL structure in the provider.

Provider structure

Getting or

setting data

Maximum precision

Scale

DBTYPE_NUMERIC

getting

precision element of DBTYPE_NUMERIC structure

scale element of DBTYPE_NUMERIC structure

DBTYPE_NUMERIC

setting

bPrecision element of DBCOLUMNINFO or DBPARAMINFO structure

bScale element of DBCOLUMNINFO or DBPARAMINFO structure

DBTYPE_VARNUMERIC

getting

precision element of DB_VARNUMERIC structure

scale element of DB_VARNUMERIC structure

DBTYPE_VARNUMERIC

setting

bPrecision element of DBCOLUMNINFO or DBPARAMINFO structure

bScale element of DBCOLUMNINFO or DBPARAMINFO structure

DBTYPE_DECIMAL

getting

29

scale element of DBTYPE_DECIMAL structure

DBTYPE_DECIMAL

setting

29

bScale element of DBCOLUMNINFO or DBPARAMINFO structure