[unixODBC-support] Prepared statements and parameters binding: wrong bound value with long type

Nick Gorham nick.gorham at easysoft.com
Thu Jul 12 14:54:09 BST 2007

CastorFou wrote:

>I'm working in C on a Red Hat and accessing a DB2 server using unixODBC
>version 2.2.12.
>All I want to do is a simple select prepared statement and it's working fine
>when the value I try to bind is not too high. The variable I want to bind is
>a long value (sizeof(long) on my machine is 8).

Use SQL_C_SBIGINT or SQL_C_UBIGINT, SQL_C_LONG always maps to a 4 byte 
value (int in your case I guess).

Nick Gorham
Easysoft Limited
http://www.easysoft.com, http://www.unixODBC.org

More information about the unixODBC-support mailing list