IBM Support

IC74009: CLI MAY TRUNCATE MULTI-BYTES CHARACTERS IN SQL COMMENTS, IT RESULTS IN SQL0104N.

Subscribe

You can track all active APARs for this component.

APAR status

  • Closed as program error.

Error description

  • CLI applications might returns SQL0104N if the SQL includes SQL
    comments with multi-bytes characters.
    NOTE: The error code varies where the SQL comment is inserted.
    
    On non-English environment, CLI truncates multi-bytes character
    in SQL comments.
    For example, the following code fails with SQL0104N if the
    program runs in Japanese environments (e.g. LANG=Ja_JP or
    DB2CODEPAGE=943).
    
     SQLHANDLE hstmt;
     SQLCHAR *stmt = (SQLCHAR *)"SELECT * FROM T1 where
    C1=\n--<Japanese character(s)>\n10";
      <snip>
     RC = SQLExecDirect(hstmt, stmt, SQL_NTS);
    
    The truncated (invalid) character codes might generate several
    kinds of SQL errors on database servers.
    

Local fix

  • Please remove multi-byte chracters from SQL comments.
    

Problem summary

  • ****************************************************************
    * USERS AFFECTED:                                              *
    * Users who use multi-byte SQL comments in CLI based           *
    * applications.                                                *
    ****************************************************************
    * PROBLEM DESCRIPTION:                                         *
    * CLI applications might returns SQL0104N if the SQL includes  *
    * SQL comments with multi-bytes characters.                    *
    * NOTE: The error code varies where the SQL comment is         *
    * inserted.                                                    *
    *                                                              *
    * On non-English environment, CLI truncates multi-bytes        *
    * character in SQL comments.                                   *
    * For example, the following code fails with SQL0104N if the   *
    * program runs in Japanese environments (e.g. LANG=Ja_JP or    *
    * DB2CODEPAGE=943).                                            *
    *                                                              *
    * SQLHANDLE hstmt;                                             *
    * SQLCHAR *stmt = (SQLCHAR *)"SELECT * FROM T1 where           *
    * C1=\n--<Japanese character(s)>\n10";                         *
    *   <snip>                                                     *
    * RC = SQLExecDirect(hstmt, stmt, SQL_NTS);                    *
    *                                                              *
    * The truncated (invalid) character codes might generate       *
    * several kinds of SQL errors on database servers.             *
    ****************************************************************
    * RECOMMENDATION:                                              *
    * Please upgrade to V9.7 FixPack 5 or later.                   *
    ****************************************************************
    

Problem conclusion

  • This problem is first fixed in DB2 V9.7 FixPack 5.
    

Temporary fix

Comments

APAR Information

  • APAR number

    IC74009

  • Reported component name

    DB2 FOR LUW

  • Reported component ID

    DB2FORLUW

  • Reported release

    970

  • Status

    CLOSED PER

  • PE

    NoPE

  • HIPER

    NoHIPER

  • Special Attention

    NoSpecatt

  • Submitted date

    2011-01-20

  • Closed date

    2012-01-02

  • Last modified date

    2012-01-02

  • APAR is sysrouted FROM one or more of the following:

    IC73995

  • APAR is sysrouted TO one or more of the following:

Fix information

  • Fixed component name

    DB2 FOR LUW

  • Fixed component ID

    DB2FORLUW

Applicable component levels

  • R970 PSN

       UP



Document information

More support for: DB2 for Linux, UNIX and Windows

Software version: 9.7

Reference #: IC74009

Modified date: 02 January 2012