Hi
I am using zOS DB2 9 and have a table which contains a varchar field which contains xml data.
I want to pull this column, and another couple of integer columns to create a complete xml document.
However, when I extract the xml from the varchar, the xml querying thinks it is text and convert the less than / greater than to the "<" html values which isn't what I want.
I almost need an XMLPRESERVE type function.
Here is an example of a query to demonstrate (it's in quotes in case any conversion happens)
"SELECT XML2CLOB(XMLCONCAT(
XMLELEMENT(NAME "Value", 1)
,XMLELEMENT(NAME "Test", '<TagOne>1</TagOne>')
)) FROM SYSIBM.SYSDUMMY1"
Note: The <TagOne>1</TagOne> value would come from my varchar column in the real query.
This outputs:
<Value>1</Value><Test><TagOne>1</TagOne></Test>
The output I actually want is:
<Value>1</Value><Test><TagOne>1</TagOne></Test>
Anyone with any ideas?
Thanks in advance
Simon