Usage of ORDER BY in XML
624360Feb 21 2008 — edited Feb 26 2008I am using a simple table to store records.
I am using sys_xmlgen, xmlforest and xmlagg functions to generate an XML. While the the records re retrived and XML is formed the sequence of the records is not as desired.
for eg: i have got 6 rows in a simple table. When a select query is written with the xml functions the xml is generated but record no 4 always occurs at the end of the xml generated. This is a consistent behaviour and occurs irrespective of all above. I have tried using order by rowid also but the problem persists.
Is there any way to retrive the XML in the order the rows were inserted in the table?