FOR ORDINALITY Read order [message #653211] |
Wed, 29 June 2016 04:09 |
pablolee
Messages: 2882 Registered: May 2007 Location: Scotland
|
Senior Member |
|
|
Morning folks.
Given the below:
with t as (select xmltype('<ROOT>
<Name>
<FirstName>FLOKI</FirstName>
<LastName/>
</Name>
<Name>
<FirstName>RAGNAR</FirstName>
<LastName>LOTHBROK</LastName>
</Name>
<Name>
<FirstName>SIGURDUR</FirstName>
<LastName>JOHANSSEN</LastName>
</Name>
</ROOT>
') xml from dual)
select x.nameid
, x.lastname
, x.firstname
from t
, xmltable(xmlnamespaces('urn:oecd:ties:stffatcatypes:v1' as "n2")
, 'ROOT/Name'
passing t.xml
columns
nameid for ordinality
, lastname varchar2(50) path '//LastName'
, firstname varchar2(50) path '//FirstName'
) x;
Can I be assured that the nameid ordinality derivation will always be the same. i.e. it does not require any 'order by' code to ensure the order (as we would with sql extracting data from a table) , rather the order is effectively a 'read' order based on a top-down approach. And so assuming that the source xml remains the same the nameid values will remain the same for each time the code is executed.
I appreciate that I might not be entirely clear here so if any further info is required, please let me know.
|
|
|
|
|