Skip to Main Content

Database Software

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!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

XQuery unable to extract value from multiple node.

User_KIXOPAug 7 2017 — edited Aug 29 2017

Hi,

I have to extract value from multiple node from a xml file. I am using the below query , but it says "ORA-31013: Invalid XPATH expression"

select extractvalue(value(wl),'*/ns2:CaptureTypeCode','xmlns ns1="http://www.pp.com/ifcs" xmlns ns2="http://www.pp.com/core"') as CaptureTypeCode,

       extractvalue(value(wl),'*/ns2:TransactionCode','xmlns ns1="http://www.pp.com/ifcs" xmlns ns2="http://www.pp.com/core"')as TransactionCode,

    extractvalue(value(wl),'*/ns2:AttentionKey','xmlns ns1="http://www.pp.com/ifcs" xmlns ns2="http://www.pp.com/core"') as AttentionKey,

    extractvalue(value(wl),'*/ns2:ReferenceNumber','xmlns ns1="http://www.pp.com/ifcs" xmlns ns2="http://www.pp.com/core"') as ReferenceNumber,

    extractvalue(value(wl),'*/ns2:OrderNumber','xmlns ns1="http://www.pp.com/ifcs" xmlns ns2="http://www.pp.com/core"') as OrderNumber,

    extractvalue(value(wl),'*/ns2:FleetNumber','xmlns ns1="http://www.pp.com/ifcs" xmlns ns2="http://www.pp.com/core"') as FleetNumber,

    extractvalue(value(wl),'*/ns2:SubEntityNumber','xmlns ns1="http://www.pp.com/ifcs" xmlns ns2="http://www.pp.com/core"') as SubEntityNumber,

    extractvalue(value(wl),'*/ns2:TransactionDateTime','xmlns ns1="http://www.pp.com/ifcs" xmlns ns2="http://www.pp.com/core"') as TransactionDateTime,

       extractvalue(value(wl),'*/ns2:AuthorisationNumber','xmlns ns1="http://www.pp.com/ifcs" xmlns ns2="http://www.pp.com/core"') as AuthorisationNumber ,

    extractvalue(value(wl),'*/ns2:OdometerReading','xmlns ns1="http://www.pp.com/ifcs" xmlns ns2="http://www.pp.com/core"') as OdometerReading,

    extractvalue(value(wl),'*/ns2:BatchNumber','xmlns ns1="http://www.pp.com/ifcs" xmlns ns2="http://www.pp.com/core"') as BatchNumber,

       extractvalue(value(wl),'*/ns2:BatchSource','xmlns ns1="http://www.pp.com/ifcs" xmlns ns2="http://www.pp.com/core"') as BatchSource

    from SAP_PRICE_FILE_TBL1 t, TABLE(xmlsequence(EXTRACT((t.content),'/ns1:LoadCardTransactions/ns1:LoadCardTransaction/ns1:Transaction')))  wl;

Please help.

This post has been answered by User_KIXOP on Aug 7 2017
Jump to Answer

Comments

Locked Post
New comments cannot be posted to this locked post.

Post Details

Locked on Sep 26 2017
Added on Aug 7 2017
4 comments
2,147 views