Selection of XML in a CLOB data which a repeating XML tags - don't know how to get each individual tag

This is an XML file that I store in a CLOB field in a table, Oracle 10

'i' <? XML version = "1.0" encoding = "utf-8"? >

< MERIDIANMASTERSEND xsi:noNamespaceSchemaLocation = "MeridianMasterSend.xsd" "xmlns: xsi =" " http://www.w3.org/2001/XMLSchema-instance ">

< MASTER_SPEC_NUMBER > 10217655 < / MASTER_SPEC_NUMBER >

< MASTER_SPEC_REVISION > 2 < / MASTER_SPEC_REVISION >

< MASTER_SPEC_DESCRIPTION > CORNNUTS JALAPENO CHEDDAR 11.3 kg in bulk FS-40 x 1-MS < / MASTER_SPEC_DESCRIPTION >

YES < RELEVANT_ALLERGEN_DATA_PROVIDED > < / RELEVANT_ALLERGEN_DATA_PROVIDED >

CASHEW nuts < ALLERGEN_ATTRIBUTE > < / ALLERGEN_ATTRIBUTE >

< ALLERGEN_LEVEL_OF_CONTAINMENT > < / ALLERGEN_LEVEL_OF_CONTAINMENT >

< ALLERGEN_SPECIFICATION_AGENCY > < / ALLERGEN_SPECIFICATION_AGENCY >

< ALLERGEN_SPECIFICATION_NAME > < / ALLERGEN_SPECIFICATION_NAME >

MILK of < ALLERGEN_ATTRIBUTE > < / ALLERGEN_ATTRIBUTE >

CONTAINS < ALLERGEN_LEVEL_OF_CONTAINMENT > < / ALLERGEN_LEVEL_OF_CONTAINMENT >

Health Canada and the CFIA < ALLERGEN_SPECIFICATION_AGENCY > < / ALLERGEN_SPECIFICATION_AGENCY >

< ALLERGEN_SPECIFICATION_NAME > food and drug B.01.010.1, B.01.010.2, B.01.010.3 < / ALLERGEN_SPECIFICATION_NAME >

SOY < ALLERGEN_ATTRIBUTE > < / ALLERGEN_ATTRIBUTE >

CONTAINS < ALLERGEN_LEVEL_OF_CONTAINMENT > < / ALLERGEN_LEVEL_OF_CONTAINMENT >

Health Canada and the CFIA < ALLERGEN_SPECIFICATION_AGENCY > < / ALLERGEN_SPECIFICATION_AGENCY >

< ALLERGEN_SPECIFICATION_NAME > food and drug B.01.010.1, B.01.010.2, B.01.010.3 < / ALLERGEN_SPECIFICATION_NAME >

< ALLERGEN_ATTRIBUTE > TREE_NUTS < / ALLERGEN_ATTRIBUTE >

< ALLERGEN_LEVEL_OF_CONTAINMENT > < / ALLERGEN_LEVEL_OF_CONTAINMENT >

< ALLERGEN_SPECIFICATION_AGENCY > < / ALLERGEN_SPECIFICATION_AGENCY >

< ALLERGEN_SPECIFICATION_NAME > < / ALLERGEN_SPECIFICATION_NAME >

< / MERIDIANMASTERSEND >

I normally query the Oracle table that stores this file XML in a CLOB column, called MDMXML by using the following query to get the different fields.

Select a.part_no, a.revision, xmltype (a.mdmxml) .extract ("/ MERIDIANMASTERSEND/MASTER_SPEC_DESCRIPTION/text()').getstringVal () 'Master Spec Description' from interspc.atmdmdata where a.master_part_no is not null")

How would be to extract the cashews, milk, soy, values of walnuts (attribute, containment level, agency of specification, the specification name) in my SQL statement above?

Otherwise, I'd be OK for a list

Glad to hear because your main requirement cannot be reached.

You cannot have a return to SELECT an unknown number of columns.

Separate line inscription makes more sense, for what is a relational database is.

Select x.*

of atmdmdata one

xmltable)

' for $i in /MERIDIANMASTERSEND

, $j in $i / ALLERGEN_ATTRIBUTE

Returns the element r {}

$j/next - sibling:ALLERGEN_LEVEL_OF_CONTAINMENT [1]

, $j/next - sibling:ALLERGEN_SPECIFICATION_AGENCY [1]

, $j/next - sibling:ALLERGEN_SPECIFICATION_NAME [1]

, $j/.

, $i / MASTER_SPEC_DESCRIPTION

}'

passage xmltype (a.mdmxml)

columns

Path of varchar2 (30) MASTER_SPEC_DESCRIPTION 'MASTER_SPEC_DESCRIPTION '.

, Path of varchar2 (30) attribute 'ALLERGEN_ATTRIBUTE '.

, Path of varchar2 (30) LEVEL_OF_CONTAINMENT 'ALLERGEN_LEVEL_OF_CONTAINMENT '.

, Path of varchar2 (30) SPECIFICATION_AGENCY 'ALLERGEN_SPECIFICATION_AGENCY '.

, Path of varchar2 (80) SPECIFICATION_NAME 'ALLERGEN_SPECIFICATION_NAME '.

) x

;

MASTER_SPEC_DESCRIPTION LEVEL_OF_CONTAINMENT SPECIFICATION_AGENCY SPECIFICATION_NAME ATTRIBUTE

------------------------------ ------------------------------ ------------------------------ ------------------------------ --------------------------------------------------------------------------------

CORNNUTS 11.3 CASHEW CHEDDAR JALAPEÑO

CORNNUTS JALAPENO CHEDDAR 11.3 MILK CONTAINS Health Canada and CFIA food and drug B.01.010.1, B.01.010.2, B.01.010.3

CORNNUTS JALAPENO CHEDDAR 11.3 SOY CONTAINS Health Canada and CFIA food and drug B.01.010.1, B.01.010.2, B.01.010.3

CORNNUTS JALAPENO CHEDDAR 11.3 TREE_NUTS

Tags: Database

Similar Questions

Maybe you are looking for

  • bought used iphone need help to activate without sim

    I bought a used iPhone 4 trying to activate, but guard saying need sim, I don't have that I just want to start so that my son can download him a few games and then I can buy a phone plan and SIM at a later date... Help

  • update 10.9.3 Mavericks and now scrolling does not work in Firefox.

    I've updated yesterday, and now the wheel on my mouse (optical mouse Belkin) does not work in Firefox. It works everywhere else, but not in Firefox.

  • Satellite A100 - BSOD on startup and often refuses to load windows.

    Hello I've had my laptop A100 little over 3 years now and there is a moment he began to stop loading when I lit. He would often be an opportunity "the window loading" icon and then stay there indefinitely. Then he began to spotaneously telling me tha

  • A few questions on Satellite A135-S2386

    Hi everyone out there:I want to get a Toshiba A135-S2386.I was told that the battery lasts for not more than 2 hours (which is very short time).Are there devices that I can get in order to extend the life of the battery? Any ideas on price in USD?Tha

  • Windows vista SP2 update failed twice

    error code 800F0816 - when the vista sp2 update is completed and the facilities, it goes in a restart, windows does not load and I get the error code after crossing the repair mode