The C data type of a buffer is specified by the application. In the case of a single variable, this occurs when the application allocates the variable. In the case of generic memory — that is, memory pointed to by a pointer of type void — this occurs when the application casts the memory to a particular type. There are two ways in which the driver discovers this type:
SQL_DATE_STRUCT Date;
SQLINTEGER DateInd;
SQLBindCol(hstmt, 1, SQL_C_TYPE_DATE, &Date, 0, &DateInd);
For more information on type identifiers, see the “Data Types in ODBC” section, later in this chapter.
SQLUINTEGER StringFuncs;
SQLGetInfo(hdbc, SQL_STRING_FUNCTIONS, (SQLPOINTER) &StringFuncs, 0,
NULL);
The driver uses the C data type to interpret the data in the buffer.