[unixODBC-support] iSeries DB2/UDB Charsets

Bob Joneson rjoneson at earlmay.com
Fri Sep 23 21:54:59 BST 2005

Been a PHP/MySQL developer for a while now. There's a growing interested to migrate much of our data to DB2.

Here's the issue I'm coming accross. When I execute an INSERT statement and the data contains characters of ASCII values greater than 127, the statement fails and returns a truncated error message. In PHP it looks like this:

Warning: odbc_exec() [function.odbc-exec]: SQL error: [unixODBC][IBM][iSeries Access ODBC Driver][DB2 UDB]SQL0104 - Token , SQL state 37000 in SQLExecDirect

Obviously the error should say "Token &1 not valid...". But it's being cut off. This leads me to believe that for one reason or another these characters are indicating an end of statement or somthing to that effect.

Now I can take the EXACT same query and put it into an SQL window in iSeries Access for Windows and it runs fine. My guess is there's some type of character conversion that the windows version is handling that the linux version is not.

Here's my setup:

Client - Fedora Core 3 / PHP 5.0.5 / unixODBC 2.2.11 / iSeries Access for Linux (ODBC Driver)
Code Page - 1208 

Server - OS/400 V5R2 / DB2 UDB / iSeries Access
Code Page - 37


Thanks in advance.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.unixodbc.org/pipermail/unixodbc-support/attachments/20050923/70f829f9/attachment.html>

More information about the unixODBC-support mailing list