[freetds] Arguments to SQLColAttribute
Bruce Seely
bseely at stsci.edu
Thu Jul 30 11:27:04 EDT 2020
In sql.log, the trace for SQLColAttribute looks like this:
[000000.200163]
alisp 1120FD5C0 ENTER SQLColAttribute
SQLHSTMT 0x7f92b46023f0
SQLUSMALLINT 1
SQLUSMALLINT 1011 (SQL_DESC_NAME)
SQLPOINTER 0x7ffeea1dafc0
SQLINTEGER * 256
SQLSMALLINT * 0x7ffeea1db1d0
SQLLEN * 0x0
[000000.201194]
alisp 1120FD5C0 EXIT SQLColAttribute with return code -1 (SQL_ERROR)
SQLHSTMT 0x7f92b46023f0
SQLUSMALLINT 1
SQLUSMALLINT 1011 (SQL_DESC_NAME)
SQLPOINTER 0x7ffeea1dafc0
SQLINTEGER * 256
SQLSMALLINT * 0x7ffeea1db1d0
SQLLEN * 0x0
The SQLColAttribute definition in odbc/odbc.c is this:
static SQLRETURN _SQLColAttribute(SQLHSTMT hstmt, SQLUSMALLINT icol, SQLUSMALLINT fDescType, SQLPOINTER rgbDesc,
SQLSMALLINT cbDescMax, SQLSMALLINT FAR * pcbDesc, SQLLEN FAR * pfDesc _WIDE);
The SQLColAttribute spec at https://www.ibm.com/support/knowledgecenter/SSEPEK_10.0.0/odbc/src/tpc/db2z_fncolattribute.html
shows it as a SQLSMALLINT
The BufferLength (5th) argument is a SQLSMALLINT in the C code, but it shows as a SQLINTEGER* in the sql.log trace.
Is this an indication that I am passing a bad 5th argument to SQLColAttribute?
Thanks,
Bruce
More information about the FreeTDS
mailing list