C to SQL: Numeric
SQL_C_STINYINT SQL_C_SLONG
The following table shows the ODBC SQL data types to which numeric C data may
be converted. For an explanation of the columns and terms in the table, see
SQL_C_UTINYINT SQL_C_ULONG
SQL_C_TINYINT SQL_C_LONG
SQL_C_SSHORT SQL_C_FLOAT
SQL_C_USHORT SQL_C_DOUBLE
SQL_C_SHORT SQL_C_NUMERIC
SQL_C_SBIGINT SQL_C_UBIGINT
SQL type identifier |
Test | SQL-
STATE |
SQL_CHAR SQL_VARCHAR SQL_LONGVARCHAR | Number of digits <= column byte length.
Number of digits > column byte length. | n/a
22001 |
SQL_DECIMAL SQL_NUMERIC SQL_TINYINT SQL_SMALLINT SQL_INTEGER SQL_BIGINT | Data converted without truncation or with truncated of fractional digits.
Data converted with truncation of whole digits. | n/a
22003 |
SQL_REAL SQL_FLOAT SQL_DOUBLE | Data is within the range of the data type to which the number is being
converted.
Data is outside the range of the data type to which the number is being converted. | n/a
22003 |
SQL_BIT | Data is 0 or 1.
Data is greater than 0, less than 2, and not equal to 1. Data is less than 0 or greater than or equal to 2. | n/a
22001 22003 |
SQL_INTERVAL_YEAR [a] SQL_INTERVAL_MONTH [a] SQL_INTERVAL_DAY [a] SQL_INTERVAL_HOUR [a] SQL_INTERVAL_MINUTE [a] SQL_INTERVAL_SECOND [a] | Data not truncated.
Data truncated. | n/a
22015 |
[a] These conversions are supported only for the exact numeric data types (SQL_C_STINYINT, SQL_C_UTINYINT, SQL_C_SSHORT, SQL_C_USHORT, SQL_C_SLONG, SQL_C_ULONG, or SQL_C_NUMERIC). They are not supported for the approximate numeric data types (SQL_C_FLOAT or SQL_C_DOUBLE). Exact numeric C data types cannot be converted to an interval SQL type whose interval precision is not a single field. |
|
|
|
|