467,146 Members | 1,060 Online
Bytes | Developer Community
Ask Question

Home New Posts Topics Members FAQ

Post your question to a community of 467,146 developers. It's quick & easy.

SQLStatistics driver bug?

Hi,

I am trying to find the number of rows in a DB2 table using ODBC
SQLStatistics. Although, the documentation claims that this is
supported, I am getting SQL_ERROR when the data is fetched (simplified
code shown below). When I run it against SQLServer, Access, Excel it
runs fine but not against DB2 and red Brick. Can anyone tell me if
this is a driver bug or am I missing something?

// Allocate a statement handle.
retcode = SQLAllocHandle(SQL_HANDLE_STMT, hdbc1, &hstmt1);

// get stats
retcode = SQLStatistics(hstmt1, NULL, 0, NULL, 0, "xyz", SQL_NTS,
SQL_INDEX_UNIQUE, SQL_QUICK /* SQL_ENSURE */); // tried both ENSURE
and QUICK

// Bind columns
SQLBindCol(hstmt1, 7, SQL_C_SSHORT, &DataType, 0, &cbDataType);
SQLBindCol(hstmt1, 11, SQL_C_SLONG, &Cardinality, 0,&cbCardinality);

// fetch results in a loop
retcode = SQLFetch(hstmt1);

FOR DB2: [IBM][CLI Driver] CLI0110E Invalid output or indicator
buffer specified. SQLSTATE=22002

FOR RedBrick: [Red Brick][ODBC Driver]** ERROR ** (10002) NULL value
in column 11, but no indicator.

TIA,
Niles
Nov 12 '05 #1
  • viewed: 1229
Share:

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

6 posts views Thread by Philip | last post: by
reply views Thread by CS Loh | last post: by
12 posts views Thread by Steve | last post: by
reply views Thread by deangc | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.