SQL to C: Year-Month Intervals
SQL_INTERVAL_YEAR
| SQL_INTERVAL_YEAR_TO_MONTH
|
SQL_INTERVAL_MONTH
|
|
C type identifier |
Test |
*TargetValuePtr | *StrLen_or
_IndPtr | SQL-
STATE |
SQL_C_INTERVAL_ MONTH [a] SQL_C_INTERVAL_ YEAR [a] SQL_C_INTERVAL_ YEAR_TO_MONTH [a] | Trailing fields portion not truncated.
Trailing fields portion truncated. Leading precision of target is not big enough to hold data from source. | Data
Truncated data Undefined | Length of data in bytes
Length of data in bytes Undefined | n/a
01S07 22015 |
SQL_C_STINYINT [b] SQL_C_UTINYINT [b] SQL_C_USHORT [b] SQL_C_SHORT [b] SQL_C_SLONG [b] SQL_C_ULONG [b] SQL_C_NUMERIC [b] SQL_C_BIGINT [b] | Interval precision was a single field and the data was converted without
truncation.
Interval precision was a single field and truncated whole. Interval precision was not a single field. | Data
Truncated data Undefined | Size of the C data type
Length of data in bytes Size of the C data type | n/a
22003 22015 |
SQL_C_BINARY | Byte length of data <= BufferLength
Byte length of data > BufferLength | Data
Undefined | Length of data in bytes
Undefined | n/a
22003 |
SQL_C_CHAR | Character byte length < BufferLength
Number of whole (as opposed to fractional) digits < BufferLength Number of whole (as opposed to fractional) digits >= BufferLength | Data
Truncated data Undefined | Size of the C data type
Size of the C data type Undefined | n/a
01004 22003 |
[a] A year-month interval SQL type can be converted to any year-month interval C type. [b] If the interval precision is a single field (one of YEAR or MONTH), then the interval SQL type can be converted to any exact numeric (SQL_C_STINYINT, SQL_C_UTINYINT, SQL_C_USHORT, SQL_C_SHORT, SQL_C_SLONG, SQL_C_ULONG, or SQL_C_NUMERIC). |
|
|
|