Example: Usage of the XMLSERIALIZE clause

This example shows the usage of the XMLSERIALIZE clause. It shows that the values of the column called DESCRIPTION in the table called PRODUCT, which is of XML data type, are inlined in the resulting output file. The XML declaration is included into the resulting strings:

[i1012@lat186(:) ~]$ db2hpu -f SYSIN_XML -i i1012
INZM031I Optim High Performance Unload for Db2 06.01.00.001(131114) 
         64 bits 11/18/2013 (Linux lat186 x86_64)
INZI473I Memory limitations: 'unlimited' for virtual memory and 'unlimited' for data segment
       ----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+
000001 GLOBAL CONNECT TO SAMPLE;
000002 UNLOAD TABLESPACE
000003 DOUBLE DELIM ON
000004 SELECT PID, DESCRIPTION FROM PRODUCT;
000005 XMLSERIALIZE (VARCHAR(310) INCLUDING XMLDECLARATION)
000006 OUTFILE("outfile")
000007 FORMAT DEL;
000008

INZU462I HPU control step start: 14:01:03.064.
INZU463I HPU control step end  : 14:01:03.473.
INZU464I HPU run step start    : 14:01:03.619.
INZU410I HPU utility has unloaded 4 rows on lat186 host for I1012.PRODUCT in outfile.
INZU465I HPU run step end      : 14:01:03.624.
INZI441I HPU successfully ended: Real time -> 0m0.559063s
User time -> 0m0.014997s : Parent -> 0m0.014997s, Children -> 0m0.000000s
Syst time -> 0m0.014997s : Parent -> 0m0.014997s, Children -> 0m0.000000s
 [i1012@lat186(:) ~]$ cat outfile 
"100","<?xml version=""1.0"" encoding=""UTF-8"" ?><pid ""100""><desc><name>Basic</name><price>9.99</price></desc></pid>"
"101","<?xml version=""1.0"" encoding=""UTF-8"" ?><pid ""101""><desc><name>Deluxe</name><price>19.99</price></desc></pid>"
"103","<?xml version=""1.0"" encoding=""UTF-8"" ?><pid ""103-""><desc><name>Super Deluxe</name><price>49.99</price></desc></pid>"
"201","<?xml version=""1.0"" encoding=""UTF-8"" ?><pid ""201""><desc><name>Windshield</name><price>3.99</price></desc></pid>"