RATE THIS ANSWER
+1
Click to Vote:
1
0
I have written programs to do what you want to do, and would be happy to provide an example, for you and anyone else who is interested.
You can get me at john.blenkinsop@ne.nykline.com
Sloopy
--------------
DB2 SQL has the capability of creating XML ...
SELECT XML2CLOB(
XMLELEMENT(NAME "DEPARTMENT",
XMLATTRIBUTES (DEPT AS "NAME" ),
XMLAGG(XMLELEMENT(NAME "EMP",
XMLELEMENT(NAME "FIRSTNAME", FNM),
XMLELEMENT(NAME "LASTNAME", LNM) )
ORDER BY LNM )
) ) AS "DEPT_LIST"
FROM TTEST
GROUP BY DEPT;
results in
<DEPARTMENT NAME="BADM "><EMP><FIRSTNAME>CHERYL </FIRSTNAME><LASTNAME>ST......
Happy DB2ing
-------------------------------------------------------------
Er... I do not know who wrote the piece above, regarding SQL generating XML. It was not me. I do have the feeling that it is not available in OS version 5 or below. Probably 6.1.
Sloopy.
=======================================================================
I can highly recommend the program from Sloopy. Its very well written and works after you made your changes according to your needs.
YuVa
Last Answered:
Oct 20 2009 3:40 PM GMT by YuVa47 
210 pts.