IBM Support

IC80658: WHEN UPDATING CLOB COLUMN WITH AN UPDATABLE CURSOR USING JCC, AN EXTRA CHARACTER (HEX VALUE 0) IS INSERTED INTO THE CLOB COLUMN.

Subscribe

You can track all active APARs for this component.

APAR status

  • Closed as program error.

Error description

  • When updating CLOB column with an updatable cursor using JCC, an
    extra character (hex value 0) is inserted into the CLOB column.
    
    For example, customer updates CLOB field with string
    "1234567890".  Issuing  select length(clob) from table returns
    11 instead of 10
    
    ...
              // Get the CLOB column
              sqlstmt = "SELECT MD_CONTENTS FROM test1"
                          + " WHERE MD_CONTENTID =? AND "
                          + " MD_PARTITION_ID =?";
    
                pstmt = mConnection.prepareStatement(sqlstmt,
    
    ResultSet.TYPE_FORWARD_ONLY,
    
    ResultSet.CONCUR_UPDATABLE );
                pstmt.setLong(1, contentID);
                pstmt.setInt(2, partitionID);
    
                rs = pstmt.executeQuery();
                rs.next();
                Clob clob = rs.getClob(1);
    
                // Populate the Clob transferring the content in
    optimum size chunks
                int size = -1;
    
                String contents = "1234567890";
                try            {
                    BufferedWriter bufWr = new
    BufferedWriter(clob.setCharacterStream(1));
                    bufWr.write(contents.toCharArray(), 0,
    contents.length());
                    bufWr.close();
                }
    ....
                rs.updateClob(1, clob);
                rs.updateRow();
    ....
    

Local fix

Problem summary

  • ****************************************************************
    * USERS AFFECTED:                                              *
    * All DB2 v9.7 users                                           *
    ****************************************************************
    * PROBLEM DESCRIPTION:                                         *
    * When updating CLOB column with an updatable cursor using     *
    * JCC, an extra character (hex value 0) is inserted into the   *
    * CLOB column.                                                 *
    *                                                              *
    * For example, customer updates CLOB field with string         *
    * "1234567890".  Issuing select length(clob) from table        *
    * returns 11 instead of 10.                                    *
    ****************************************************************
    * RECOMMENDATION:                                              *
    * Upgrade to DB2 v9.7 FP6                                      *
    ****************************************************************
    

Problem conclusion

  • Fixed in DB2 Version 9.7 Fix Pack 6
    

Temporary fix

Comments

APAR Information

  • APAR number

    IC80658

  • 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

    2012-01-04

  • Closed date

    2012-06-19

  • Last modified date

    2012-06-19

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

  • 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

  • R970 PSY

       UP



Document information

More support for: DB2 for Linux, UNIX and Windows

Software version: 9.7

Reference #: IC80658

Modified date: 19 June 2012