Skip to Main Content

SQL & PL/SQL

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!

does XMLTABLE guarantee the order of nodes

Mustafa KALAYCIMar 7 2017 — edited Mar 7 2017

Hello everyone,

I have a question, I googled it and also searched the forum and look the documentation but couldn't find a clear answer:

SELECT *

FROM XMLTABLE('/a/b'

               PASSING xmltype('<a><b>1</b><b>3</b><b>5</b></a>')

               COLUMNS

                 b varchar2(6) path '/b'

             );

when you run the sql above, you will see the rows 1, 3 and 5 but is this order is guaranteed?

I have provider that allow me get data via web services. One of the web service takes an data array (some ID data) from me and returns a result that looks like above, there are more than same nodes and order of this nodes are important because web service returns the result in same order with array data that I sent . When I parse that xml result via XMLTABLE, is it guaranteed to fetch rows with same order in xml? I mean, by using sql above, could it be in order as: 5 - 1 - 3 or it will be always 1 - 3 - 5.

thanks.

This post has been answered by AlbertoFaenza on Mar 7 2017
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Apr 4 2017
Added on Mar 7 2017
9 comments
1,128 views