[unixODBC-support] SQL_C_ULONG size on ppc64 platform

Nick Gorham nick at lurcher.org
Mon Aug 1 21:49:52 BST 2011

On 01/08/2011 19:01, Phil Sanders wrote:
> I am debugging  an application that is running on an Red Hat 6 ppc64 
> distribution. It is attempting to insert and fetch data using a c 
> /long/  type value and using the corresponding SQL type SQL_C_LONG.
> It appears that unixODBC assumes that an SQL_C_LONG is only a 32-bit 
> value based on what is seen in the variable/tables after reading or 
> writing the value.  That causes the data to be garbled. If I change it 
> to an SQL_C_SBIGINT or read/write into an int32_t, everything is fine.
> I am trying to decide if unixODBC is compiled correctly for this 
> environment or if somewhere it states that SQL_C_LONG types are always 
> only 4 bytes in size.  Any guidance or help would be appreciated
> - Phil
> _______________________________________________
> unixODBC-support mailing list
> unixODBC-support at mailman.unixodbc.org
> http://mailman.unixodbc.org/mailman/listinfo/unixodbc-support
Yes. SQL_C_LONG is a 32 bit type, SQL_C_SMALLINT 16 bit and SQL_C_BIGINT 
64. This doesnt change on 32/64 bit platforms. The names are a hangover 
from windows where a long is 32 bit both on 64 and 32 bit builds.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.unixodbc.org/pipermail/unixodbc-support/attachments/20110801/3bb0e8d8/attachment.html>

More information about the unixODBC-support mailing list