Skip to Main Content

DevOps, CI/CD and Automation

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!

Reading XMLTYPE Column With Parent and Multiple Child Nodes

Vinod1900Apr 6 2012 — edited Apr 9 2012
Hi,

I have a xmltype column which stores the data in below format. There are possible that some of the parent node will have multiple child nodes. I am not able to extract the child nodes. Getting the error as multiset value... singleton required...
I tried the below query but it returns only the records of parent with child nodes.

<CrntRgstns>
<CrntRgstn empStDt="2000-08-21" Auth="ABCD" regCat="BM" u4FlngDt="2011-05-12" stDt="2011-11-08" st="PURGED" actvReg="N" updateTS="2011-11-08T00:37:42">
<CrntDfcnys/>
</CrntRgstn>
<CrntRgstn empStDt="2000-08-21" Auth="ABCD" regCat="BM" u4FlngDt="2012-01-13" stDt="2012-01-13" st="DEFICIENT" actvReg="Y" updateTS="2012-01-13T18:02:19">
<CrntDfcnys>
<CrntDfcny dfcnyCd="EXAM" exmCd="M10" createDt="2012-01-13"/>
<CrntDfcny dfcnyCd="EXAM" exmCd="X40" createDt="2012-01-13"/>
</CrntDfcnys>
</CrntRgstn>
<CrntRgstn empStDt="2000-08-21" Auth="XYZ" regCat="SU" u4FlngDt="2012-01-13" stDt="2012-01-13" st="DEFICIENT" actvReg="Y" updateTS="2012-01-13T18:02:19">
<CrntDfcnys>
<CrntDfcny dfcnyCd="EXAM" exmCd="M10" createDt="2012-01-13"/>
<CrntDfcny dfcnyCd="EXAM" exmCd="X40" createDt="2012-01-13"/>
</CrntDfcnys>
</CrntRgstn>
</CrntRgstns>

I tried using 2 xmltable querys and using child node of xmltable 1 as input to xmltable 2. But this will return only those records which has child nodes. But i wanted all records from CrntRgstn and if any child node CrntDfcnys then display that also.

Thanks,
Vinod K
This post has been answered by odie_63 on Apr 6 2012
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on May 7 2012
Added on Apr 6 2012
2 comments
2,674 views