home clear 64x64
en blue 200x116 de orange 200x116 info letter User
suche 36x36
Neueste VersionenFixList
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
Haben Sie Probleme? - Kontaktieren Sie uns.
Kostenlos registrieren anmeldung-x26
Kontaktformular kontakt-x26

DB2 - Problembeschreibung

Problem IC62955 Status: Geschlossen

SQL16061 RETURNED WHEN CASTING HEXBINARY, BASE64BINARY TO VARCHAR FOR
BIT DATA DATA TYPE

Produkt:
DB2 FOR LUW / DB2FORLUW / 970 - DB2
Problembeschreibung:
A sql16061 error may be incorrectly raised when casting XML 
value of xs:hexBinary, xs:base64Binary encoding to VARCHAR FOR 
BIT DATA data type. 
 
The error indicates that the length specified for the varchar 
for bit data type is not large enough for the encoded xml value. 
 
For example, in the following query, if the element 
<executable_id> is encoded in a 32-byte array using 
xs:hexBinary(which means it is encoded using 64 characters), 
extracting this element as  type varchar(32) for bit data will 
raise an error when it should not.  This is because we are 
checking the length of the character string value of 64 bytes 
instead of checking the length of the  encoded binary 
(hexBinary value) which is 32 bytes. 
 
SELECT EXECUTABLE_ID 
FROM 
XMLTABLE ( 
'$doc/details' PASSING XMLPARSE( DOCUMENT 
DETAILS) as "doc"     COLUMNS "EXECUTABLE_ID" VARCHAR(32) FOR 
BIT DATA PATH  'executable_id cast as xs:hexBinary' 
) AS DETAILS; 
 
Sample Doc: 
 
<details> 
 ... 
<executable_id>0100000000000000010000000000000000000000020020090 
421100437514686</executable_id> 
... 
</details>
Problem-Zusammenfassung:
**************************************************************** 
* USERS AFFECTED:                                              * 
* DB2 LUW All Platforms                                        * 
**************************************************************** 
* PROBLEM DESCRIPTION:                                         * 
* A sql16061 error may be incorrectly raised when casting XML  * 
*                                                              * 
* value of xs:hexBinary, xs:base64Binary encoding to VARCHAR   * 
* FOR                                                          * 
* BIT DATA data type.                                          * 
*                                                              * 
*                                                              * 
*                                                              * 
* The error indicates that the length specified for the        * 
* varchar                                                      * 
* for bit data type is not large enough for the encoded xml    * 
* value.                                                       * 
*                                                              * 
*                                                              * 
* For example, in the following query, if the element          * 
*                                                              * 
* <executable_id> is encoded in a 32-byte array using          * 
*                                                              * 
* xs:hexBinary(which means it is encoded using 64 characters), * 
*                                                              * 
* extracting this element as  type varchar(32) for bit data    * 
* will                                                         * 
* raise an error when it should not.  This is because we are   * 
*                                                              * 
* checking the length of the character string value of 64      * 
* bytes                                                        * 
* instead of checking the length of the  encoded binary        * 
*                                                              * 
* (hexBinary value) which is 32 bytes.                         * 
*                                                              * 
*                                                              * 
*                                                              * 
* SELECT EXECUTABLE_ID                                         * 
*                                                              * 
* FROM                                                         * 
*                                                              * 
* XMLTABLE (                                                   * 
*                                                              * 
* '$doc/details' PASSING XMLPARSE( DOCUMENT                    * 
*                                                              * 
* DETAILS) as "doc"     COLUMNS "EXECUTABLE_ID" VARCHAR(32)    * 
* FOR                                                          * 
* BIT DATA PATH  'executable_id cast as xs:hexBinary'          * 
*                                                              * 
* ) AS DETAILS;                                                * 
*                                                              * 
*                                                              * 
*                                                              * 
* Sample Doc:                                                  * 
*                                                              * 
*                                                              * 
*                                                              * 
* <details>                                                    * 
*                                                              * 
*  ...                                                         * 
*                                                              * 
* <executable_id>01000000000000000100000000000000000000000200200 
* 421100437514686</executable_id>                              * 
*                                                              * 
* ...                                                          * 
*                                                              * 
* </details>                                                   * 
**************************************************************** 
* RECOMMENDATION:                                              * 
* Upgrade to DB2 v97 Fixpack 1                                 * 
****************************************************************
Local-Fix:
For the VARCHAR FOR BIT length, use a length value which is 
equal or larger to the character string size before its encoded 
to hexBinary or base64Binary. In the example listed the work 
around would be using VARCHAR(64) FOR BIT DATA
verfügbare FixPacks:
DB2 Version 9.7 Fix Pack 1 for Linux, UNIX, and Windows
DB2 Version 9.7 Fix Pack 2 for Linux, UNIX, and Windows
DB2 Version 9.7 Fix Pack 3 for Linux, UNIX, and Windows
DB2 Version 9.7 Fix Pack 3a for Linux, UNIX, and Windows
DB2 Version 9.7 Fix Pack 4 for Linux, UNIX, and Windows
DB2 Version 9.7 Fix Pack 5 for Linux, UNIX, and Windows
DB2 Version 9.7 Fix Pack 7 for Linux, UNIX, and Windows
DB2 Version 9.7 Fix Pack 9a for Linux, UNIX, and Windows
DB2 Version 9.7 Fix Pack 6 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 10 for Linux, UNIX, and Windows

Lösung
The problem occurs because we are checking the length of the 
character string value of 64 bytes 
instead of checking the length of the  encoded binary (hexBinary 
value) which is 32 bytes.
Workaround
keiner bekannt / siehe Local-Fix
Weitere Daten
Datum - Problem gemeldet    :
Datum - Problem geschlossen :
Datum - der letzten Änderung:
02.09.2009
23.02.2010
23.02.2010
Problem behoben ab folgender Versionen (IBM BugInfos)
9.7.FP1
Problem behoben lt. FixList in der Version
9.7.0.1 FixList