I created an Oracle stored proc that queries a parent and child table and returns a sysrefcursor containing the data. My ASP.NET 2.0 page gets that as a dataset then converts it to an XML string.
Problem: the XML is not "normalized". It repeats the parent for each child record that exists.
Question: Is it possible to return the dataset so when it is converted to XML, the XML embeds the children like this? In other words, the parent does not repeat for each child? Is this something I must do programmatically (build
my own XML by looping through the non-normalized data)?
arecev
Member
267 Points
185 Posts
PL/SQL return a dataset so XML embeds children?
Jul 19, 2010 07:57 PM|LINK
I created an Oracle stored proc that queries a parent and child table and returns a sysrefcursor containing the data. My ASP.NET 2.0 page gets that as a dataset then converts it to an XML string.
Problem: the XML is not "normalized". It repeats the parent for each child record that exists.
Question: Is it possible to return the dataset so when it is converted to XML, the XML embeds the children like this? In other words, the parent does not repeat for each child? Is this something I must do programmatically (build my own XML by looping through the non-normalized data)?
<PARENT>
<PARENT_ID>
<PARENT_NAME>
<CHILD_DATES>
<CHILD_YEAR>
<CHILD_MONTH>
<CHILD_DAY>
</CHILD_DATES>
</PARENT>
Thanks!