SQL to C conversion for numeric data
You can convert numeric SQL data types into C data types.
The numeric SQL data types are:
- SQL_DECIMAL
- SQL_DECFLOAT
- SQL_NUMERIC
- SQL_SMALLINT
- SQL_INTEGER
- SQL_BIGINT
- SQL_REAL
- SQL_FLOAT
- SQL_DOUBLE
The following table shows information about converting numeric SQL data to C data.
fCType | Test | rgbValue | pcbValue | SQLSTATE |
---|---|---|---|---|
|
Display size < cbValueMax | Data | Data length (in bytes) | 000001 |
Number of significant digits < cbValueMax | Truncated data | Data length (in bytes) | 01004 | |
Number of significant digits >= cbValueMax | Untouched | Data length (in bytes) | 22003 | |
|
Data converted without truncation2 | Data | Size (in bytes) of the C data type | 000001 |
Data converted with truncation, but without loss of significant digits2 | Truncated data | Size (in bytes) of the C data type | 01004 | |
Conversion of data would result in loss of significant digits2 | Untouched | Size (in bytes) of the C data type | 22003 | |
Notes:
|