[unixODBC-dev] Issue with ODBC on 64 bit machine while using SQLUINTEGER and SQLINTEGER

qureshifaizan faiz qureshifaizan at gmail.com
Thu Mar 27 06:50:22 GMT 2008


Hello Freinds,
Thanks for the reply.Take this simple example

"select ID from TEST_TABLE where TEST_VALUE = ?"

This query works fine in CLI using mysql 5.1.

But in the application when i EXECUTE this query iam unable to fetch the
data using the SQLFetch and it returns DB_NO_DATA with a result code 100 or
some times gives a junk value.
The procedure i have followed is as follows.

i have used SQLUINTEGER for the input parameter in case of SQLBindParameter.

SQLUINTEGER value;
SQLBindParameter(sthdl,1,SQL
_PARAM_INPUT,SQL_C_ULONG,SQL_INTEGER,00,0,&value,00,00);

SQINTEGER indIdValue;
SQLUINTEGER idValue;
retCode =
SQLBindCol(sthdl,1,SQL_C_ULONG,&idValue,sizeof(idValue),&indIdValue);
and same in the case of out put SQLBindCol

//steps followed are.
SQLPrepare
SQLBindParameter
SQLExecute
SQLBindCol
SQLFetch

Iam executing this on a 64 bit machine with mysql 5.1.

But the same code works fine on a 32 bit machine with mysql4.0.

Iam not getting clue what the problem is.I will be very grateful if you
could help
me solve this problem

Regards
Faizan.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.unixodbc.org/pipermail/unixodbc-dev/attachments/20080327/1a2e7933/attachment.html>


More information about the unixODBC-dev mailing list