Reading XMLTYPE Column With Parent and Multiple Child Nodes
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