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!

Dynamic xmlnamespaces in xmltable

NelsonMendesFeb 23 2017 — edited Feb 24 2017

Hi all,

Is it possible to have dynamic arguments in xmlnamespaces?

can you point me some directions, please?

  with x as(

  select rownum as idx, x.*

  from

    (select XMLType.createxml(p_xml) xml from dual) t,

    xmltable(

    xmlnamespaces (

    'http://schemas.xmlsoap.org/soap/envelope/' as "soap",

    'http://webservices.org.com/method/' as "data2",

    'http://schemas.org.com/method' as "data3",

    default 'http://schemas.org.com/method'

    ),

    'soap:Envelope/soap:Body/data2:method/data3:RecordSet/RecordItem/CustomFieldList/FieldAndValueItem'

    passing t.xml

    columns

      ident varchar2(1000) path 'FieldName',

      val varchar2(1000) path 'FieldValue'

    ) x

  )

  select max(val) val, ident

  from x

  group by ident

in here:

    xmlnamespaces (

    'http://schemas.xmlsoap.org/soap/envelope/' as "soap",

    'http://webservices.org.com/method/' as "data2",

    'http://schemas.org.com/method' as "data3",

    default 'http://schemas.org.com/method'

Thanks,

Neo

This post has been answered by Solomon Yakobson on Feb 24 2017
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Mar 24 2017
Added on Feb 23 2017
9 comments
1,459 views