Skip to Main Content

Database Software

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

How to include CDATA in xml generated from XQuery

543512Feb 7 2007 — edited Feb 9 2007
I need to include Cdata in the xml generated from my xquery which is given below:
I tried using XMLCDATA, but not getting the desired output. What am I doing wrong?

SELECT XMLQuery('<InsUpdDel>
{
for $crv in ora:view("RELATION")
return
<first>
<eff_date>{$crv/ROW/EFF_DATE/text()}</eff_date>
<source>{$crv/ROW/SOURCE/text()}</source>
<key>
<fld>
<id>from_type</id>
<val>XMLCDATA({$crv/ROW/FROM_ENT_TYPE/text()})</val>
</fld>
<fld>
<id>from_ent_id</id>
<val>{$crv/ROW/FROM_ENT_ID/text()}</val>
</fld>
</key>
</first>}</InsUpdDel>'
RETURNING CONTENT)
FROM dual;

The output I get is XMLCDATA(C), while the desired output is <![CDATA[C]]>
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Mar 9 2007
Added on Feb 7 2007
7 comments
2,381 views