Topic
IC4NOTICE: developerWorks Community will be offline May 29-30, 2015 while we upgrade to the latest version of IBM Connections. For more information, read our upgrade FAQ.
2 replies Latest Post - ‏2008-11-13T07:41:40Z by SystemAdmin
SystemAdmin
SystemAdmin
262 Posts
ACCEPTED ANSWER

Pinned topic SQL0104 when inserting utf-8 characters

‏2007-09-03T10:39:32Z |
Hi,

When data manipulating accentuated characters I get an SQL0104 error.

Example:
$ isql -v as400 mr ...
SQL> create table bug (c varchar(10))
ISQLINFO: SQLExecute returned SQL_SUCCESS_WITH_INFO
SQLRowCount returns 0
SQL> insert into bug value('an accent: é')
37000unixODBCIBMPilote ODBC iSeries AccessDB2 UDBSQL0104 - Texte de message d'erreur non disponible. La conversion du message ne peut pas aboutir.
ISQLERROR: Could not SQLPrepare

This some configuration information

System is Red Hat EL 3

mrechte@serveur2 marches$ locale
LANG=fr_FR.UTF-8
LC_CTYPE="fr_FR.UTF-8"
LC_NUMERIC="fr_FR.UTF-8"
LC_TIME="fr_FR.UTF-8"
LC_COLLATE="fr_FR.UTF-8"
LC_MONETARY="fr_FR.UTF-8"
LC_MESSAGES="fr_FR.UTF-8"
LC_PAPER="fr_FR.UTF-8"
LC_NAME="fr_FR.UTF-8"
LC_ADDRESS="fr_FR.UTF-8"
LC_TELEPHONE="fr_FR.UTF-8"
LC_MEASUREMENT="fr_FR.UTF-8"
LC_IDENTIFICATION="fr_FR.UTF-8"
LC_ALL=
CCSID Linux (utf-8): 1208 (x04B8)
CCSID AS/400: 297 (x0129)

mrechte@serveur2 marches$ /opt/ibm/iSeriesAccess/bin/cwbnltbl 1208 297

cwbnltbl - Download conversion table utility
Using system: AS400.SAHLMREGIONELBEUF.FR
Support for conversions from 1208 to 297 ready.
mrechte@serveur2 marches$ /opt/ibm/iSeriesAccess/bin/cwbnltbl 297 1208

cwbnltbl - Download conversion table utility
Using system: AS400.SAHLMREGIONELBEUF.FR
Support for conversions from 297 to 1208 ready.

What could be the problem ?

Many thanks
Updated on 2008-11-13T07:41:40Z at 2008-11-13T07:41:40Z by SystemAdmin
  • SystemAdmin
    SystemAdmin
    262 Posts
    ACCEPTED ANSWER

    Re: SQL0104 when inserting utf-8 characters

    ‏2008-01-29T15:15:24Z  in response to SystemAdmin
    Hello

    This is a reported issue and it will be fixed in the next release, probably at the end of February.

    In the meantime you could work-around the issue by using prepared statements or setting the locale to non-UTF, ie fr_FR w/o .utf8

    Thanks!
  • SystemAdmin
    SystemAdmin
    262 Posts
    ACCEPTED ANSWER

    Re: SQL0104 when inserting utf-8 characters

    ‏2008-11-13T07:41:40Z  in response to SystemAdmin
    Hi, I had a similar problem and I finally solved it!
    I use a Fedora Core 4 Distribution.
    By default the locale of a common Linux distribution is UTF-8, to change it edit the file:
    /etc/sysconfig/i18n
    and change this line:
    LANG="en_US.utf-8"
    to this:
    LANG="en_US.iso8859-1"
    Relog and launch the command "locale" to verify the changes.
    Try to run a sql statement with the special characters:
    #> isql steuro_gip
    > select * from anpro00f where A§COAR='';

    You should NOT see the error "Could not SQL Prepare" anymore.

    Regards,
    -Andrea Signorini