home clear 64x64
en blue 200x116 de orange 200x116 info letter User
suche 36x36
Latest versionsfixlist
11.1.0.7 FixList
10.5.0.9 FixList
10.1.0.6 FixList
9.8.0.5 FixList
9.7.0.11 FixList
9.5.0.10 FixList
9.1.0.12 FixList
Have problems? - contact us.
Register for free anmeldung-x26
Contact form kontakt-x26

DB2 - Problem description

Problem IC80658 Status: Closed

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

product:
DB2 FOR LUW / DB2FORLUW / 970 - DB2
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 
 
... 
          // 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(); 
....
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                                      * 
****************************************************************
Local Fix:
available fix packs:
DB2 Version 9.7 Fix Pack 6 for Linux, UNIX, and Windows
DB2 Version 9.7 Fix Pack 7 for Linux, UNIX, and Windows
DB2 Version 9.7 Fix Pack 8 for Linux, UNIX, and Windows
DB2 Version 9.7 Fix Pack 9 for Linux, UNIX, and Windows
DB2 Version 9.7 Fix Pack 9a for Linux, UNIX, and Windows
DB2 Version 9.7 Fix Pack 10 for Linux, UNIX, and Windows

Solution
Fixed in DB2 Version 9.7 Fix Pack 6
Workaround
not known / see Local fix
Timestamps
Date  - problem reported    :
Date  - problem closed      :
Date  - last modified       :
04.01.2012
19.06.2012
19.06.2012
Problem solved at the following versions (IBM BugInfos)
9.7.FP6
Problem solved according to the fixlist(s) of the following version(s)
9.7.0.6 FixList