Skip to Content.
Sympa Menu

freetds - [freetds] Arguments to SQLColAttribute

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: Bruce Seely <bseely AT stsci.edu>
  • To: "freetds AT lists.ibiblio.org" <freetds AT lists.ibiblio.org>
  • Subject: [freetds] Arguments to SQLColAttribute
  • Date: Thu, 30 Jul 2020 15:27:04 +0000


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



Archive powered by MHonArc 2.6.24.

Top of Page