A fix is available
APAR status
Closed as program error.
Error description
When serializing XML data, the space character might not be added between two atomic values.
Local fix
No Work Around
Problem summary
**************************************************************** * USERS AFFECTED: All DB2 9 for z/OS and DB2 10 for z/OS * * users of XML. * **************************************************************** * PROBLEM DESCRIPTION: This APAR fixes two problems: * * 1. A space character is not added * * between two atomic values when * * serializing an XML value which is * * constructed by an XML publishing * * function or if it contains zero * * length string. * * 2. When an XPath variable is cast * * from decimal to integer by the * * xs:integer function, the data type * * of the original variable is changed * * to integer also. * **************************************************************** * RECOMMENDATION: * **************************************************************** This APAR fixes two problems: 1. A space character is not added between two atomic values when serializing an XML value which is constructed by an XML publishing function or if it contains zero length string. For example: 1. The following query serializes an XML value which is constructed by an XML publishing function. SELECT XMLELEMENT(NAME "result", XMLCONCAT( XMLQUERY('fn:string("value")'), XMLQUERY('fn:string("is")'), XMLQUERY('fn:string(/a/b)' PASSING XMLPARSE(DOCUMENT '<a><b>111</b></a>')))) FROM SYSIBM.SYSDUMMY1; In the query, three atomic values, "value" "is" "111", are the content of element "result". A space character should be added in between those atomic values when they are serialized. Currently, DB2 serializes the XML value as: <result>valueis111</result> (no space character added) The correct output should be: <result>value is 111</result> (space character added) 2. The following query serializes an XML value which contains a zero length string. SELECT XMLCONCAT( XMLQUERY('fn:string("value")'), XMLQUERY('fn:string("")'), XMLQUERY('fn:string(/a/b)' PASSING XMLPARSE(DOCUMENT '<a><b>111</b></a>'))) FROM SYSIBM.SYSDUMMY1; There should be a space character added for the empty string atomic value. Currently, DB2 serializes the XML value as: value 111 (only one space character added) The correct output should be: value 111 (two space characters added) 2. When an XPath variable is cast from decimal to integer by the xs:integer function, the data type of the original variable is changed to integer. For example: In the following query, the data type of $i is decimal and the value is 123.45. There is an xs:integer to cast $i to integer. This will change the data type of $i to integer and make the query return incorrect output 123;123. The correct output of the query should be 123.45;123. SELECT XMLQUERY( 'fn:concat($i, ";", xs:integer($i))' PASSING 123.45 AS "i") FROM SYSIBM.SYSDUMMY1;
Problem conclusion
DB2 is modified to add a space character in between atomic values during serialization of XML values and not to change the data type of the original XPath variable when casting from decimal to integer. Additional keywords: SQLXML XMLALL DB2INCORR/K INCORROUT SQLINCORROUT
Temporary fix
Comments
APAR Information
APAR number
PM37959
Reported component name
DB2 OS/390 & Z/
Reported component ID
5740XYR00
Reported release
910
Status
CLOSED PER
PE
NoPE
HIPER
NoHIPER
Special Attention
NoSpecatt
Submitted date
2011-04-28
Closed date
2011-09-12
Last modified date
2011-10-03
APAR is sysrouted FROM one or more of the following:
APAR is sysrouted TO one or more of the following:
UK71829 UK71830
Modules/Macros
DSNNCTIB DSNNOBSC DSNNOBSE DSNNOBXS DSNNOCCN DSNNOSCO DSNNOSER DSNNOXSS DSNNQCOM DSNNQOP DSNNQRES DSNNQXCA
Fix information
Fixed component name
DB2 OS/390 & Z/
Fixed component ID
5740XYR00
Applicable component levels
Fix is available
Select the PTF appropriate for your component level. You will be required to sign in. Distribution on physical media is not available in all countries.
[{"Business Unit":{"code":"BU059","label":"IBM Software w\/o TPS"},"Product":{"code":"SSEPEK","label":"Db2 for z\/OS"},"Component":"","ARM Category":[],"Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"9.1","Edition":"","Line of Business":{"code":"LOB10","label":"Data and AI"}},{"Business Unit":{"code":"BU054","label":"Systems w\/TPS"},"Product":{"code":"SG19M","label":"APARs - z\/OS environment"},"Component":"","ARM Category":[],"Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"9.1","Edition":"","Line of Business":{"code":"","label":""}}]
Document Information
Modified date:
03 October 2011