SQL to C: Time
SQL_TYPE_TIME
The following table shows the ODBC C data types to which time SQL data may be
converted. For an explanation of the columns and terms in the table, see
C Type Identifier |
Test |
*TargetValuePtr | *StrLen_or
_IndPtr | SQL-
STATE |
SQL_C_CHAR | BufferLength > Character byte length
9 <= BufferLength <= Character byte length BufferLength < 9 | Data
Truncated data [a] Undefined | Length of data in bytes
Length of data in bytes Undefined | n/a
01004 22003 |
SQL_C_BINARY | Byte length of data <= BufferLength
Byte ength of data > BufferLength | Data
Undefined | Length of data in bytes
Undefined | n/a
22003 |
SQL_C_TYPE_TIME | None [b]
| Data
| 6 [d]
| n/a
|
SQL_C_TYPE_ TIMESTAMP | None [b]
| Data [c]
| 16 [d]
| n/a
|
[a] The fractional seconds of the time are truncated. [b] The value of BufferLength is ignored for this conversion. The driver assumes that the size of *TargetValuePtr is the size of the C data type. [c] The date fields of the timestamp structure are set to the current date and the fractional seconds field of the timestamp structure is set to zero. [d] This is the size of the corresponding C data type. |
|
|
|