Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3212300
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T14:49:27+00:00 2026-05-17T14:49:27+00:00

I have an oracle table which has a column that stores XML in a

  • 0

I have an oracle table which has a column that stores XML in a CLOB format. The XML has the following syntax:

<?xml version="1.0" encoding="ISO-8859-1" ?> 
 <BaseXML Version="2009.4">
 <InvoiceCanvasDetails>
     <Grouping>
       <ParentGroup Name=”Parent group 1” ID=”100”>
        <ParentGroupLineItems>
         <Item ID="461616" Name=”Item 1”>
           <Papers Quantity=10000>
                          <Paper Name="UNCOATED GROUNDWOOD SCA+ (25X38)"    
                                      ID="126287" Weight="1268" Type=”A4” /> 
                          <Paper Name="COATED GROUNDWOOD SCA+ (25X38)"    
                                      ID="126288" Weight="1290" Type=”A4” />
                     </Papers>
              </Item>
       </ParentGroupLineItems>
    </ParentGroup>
  </Grouping>
 </InvoiceCanvasDetails>
</BaseXML>

Now, I want to retrieve only the Paper information corresponding to each item. ie, Given an item ID, retrieve all the papers associated to it using a query. Please guide me which is the best way to do this.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-17T14:49:28+00:00Added an answer on May 17, 2026 at 2:49 pm

    You can use a combination of extract and extractvalue:

    SQL> SELECT extractvalue(column_value, 'Paper/@Name') NAME,
      2         extractvalue(column_value, 'Paper/@ID') ID,
      3         extractvalue(column_value, 'Paper/@Weight') Weight,
      4         extractvalue(column_value, 'Paper/@Type') TYPE
      5    FROM TABLE (SELECT xmlsequence(XMLTYPE(a).extract('BaseXML/' ||
      6                                             'InvoiceCanvasDetails/' ||
      7                                             'Grouping/ParentGroup/' ||
      8                                             'ParentGroupLineItems/' ||
      9                                             'Item/Papers/Paper'))
     10                   FROM t);
    
    NAME                                     ID         WEIGHT     TYPE
    ---------------------------------------- ---------- ---------- -----
    UNCOATED GROUNDWOOD SCA+ (25X38)         126287     1268       A4
    COATED GROUNDWOOD SCA+ (25X38)           126288     1290       A4
    

    If you’re looking for a specific ID, you can filter data directly in the extract function:

    SQL> SELECT extract(XMLTYPE(a),
      2                  'BaseXML/InvoiceCanvasDetails/Grouping/' ||
      3                  'ParentGroup/ParentGroupLineItems/' ||
      4                  'Item/Papers/Paper[@ID="126287"]') ext
      5    FROM t;
    
    EXT
    --------------------------------------------------------------------------------
    <Paper Name="UNCOATED GROUNDWOOD SCA+ (25X38)" ID="126287" Weight="1268" Type="A
    4"/>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this table in an Oracle DB which has a primary key defined
I have an entity that maps to an external oracle table which is one
I have an Oracle table which contains event log messages for an application. We
I have an Access 2002 application which links an Oracle table via ODBC with
Say I have an Oracle PL/SQL block that inserts a record into a table
Given: Oracle 10.2g is the database I have a table called emp. emp has
I'll simplify the problem as much as possible: I have an oracle table: row_priority,
I have a table like this (Oracle, 10) Account Bookdate Amount 1 20080101 100
I have a table, users, in an Oracle 9.2.0.6 database. Two of the fields
I am using Oracle 10g Enterprise edition. A table in our Oracle database stores

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.