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

CastorFou castorfou at yahoo.com
Thu Jul 12 15:06:30 BST 2007


Ok thanks it works.. I've tried like every possibility for the SQL parameter
but never could have figured out that SQL_C_LONG would in fact stand for
int.. :)


Nick Gorham wrote:
> 
> CastorFou wrote:
> 
>>Hi,
>>
>>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
> 
> _______________________________________________
> unixODBC-support mailing list
> unixODBC-support at easysoft.com
> http://mail.easysoft.com/mailman/listinfo/unixodbc-support
> 
> 

-- 
View this message in context: http://www.nabble.com/Prepared-statements-and-parameters-binding%3A-wrong-bound-value-with-long-type-tf4067988.html#a11560711
Sent from the unixODBC - Support mailing list archive at Nabble.com.




More information about the unixODBC-support mailing list