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 8527435
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T08:33:24+00:00 2026-06-11T08:33:24+00:00

We are using Oracle 11g database with XMLDB installation. We are having table with

  • 0

We are using Oracle 11g database with XMLDB installation. We are having table with XMLType columns. The structure of the XML will be same for all the rows in a table. The table will have other fiedls also.

Now I want to retrieve only the values of the particular node’s attribute values from all the rows as a string with some other relational fields. The table columns retrieved can be like TemplateId, TemplateVid,TemplatepartId.

The structure of the XML can be as follows:

<Template ID=1000 VID=1>
  <TemplateParts>
    <Template ID="4000" VID="1"/>
    <Template ID="4001" VID="1"/>
  </TemplateParts>
</Template>

So the table will have data for Template with TemplateId,Vid and TemplateXML. The TemplateXML field is an XMLType field. Now I want to retrieve all the TemplateId,Vid and its refereced template partIds as an XML table. The output should be as follows:

TemplateId - TemplateVid - TemplatePartId - TemplatepartVid
1000           1             4000             1
1000           1             4001             1

So anybody comes up with a correct Xquery for the above requirement.

  • 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-06-11T08:33:25+00:00Added an answer on June 11, 2026 at 8:33 am

    As I have mentioned in my earlier comment, I have managed to get the IDs and VIDs which is stored under the Node /Template/TemplateParts/Template from xmltype column of all the rows. The query is as follows:

    select distinct  x.value as TemplatePartId,Y.Value as Vid from 
    TempVersion t ,
    xmltable('/Template/TemplateParts/Template' passing t.CONTENT columns  value    varchar2(10) path '@ID' ) x,
      xmltable('/Template/TemplateParts/Template' passing t.CONTENT columns  value varchar2(10) path '@VID' ) y
        order by TemplatePartId;
    

    If sombody know better format,please post your sample query. I need as a normal query as the above format is not supported by my ORM tool. If you look at the above query you can notice that the XMLTable expression is to be placed after the From clause. This gives trouble when I try to form this query through my LLBLGen ORM tool.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using Oracle Client 11.2.0.3 with 11g Oracle database and having troubles to convert
I am using REGEXP_SUBSTR in Oracle 11g and I am having difficulty trying to
we have written a C# 3.5 client talking to an Oracle database (11g) using
first some data: we are using Oracle 11g databases. A primary database running on
I am using the external table approach with Oracle 11g to load data from
I am using oracle 11g. I write code to connect oracle database with java
We have an Oracle 11g database table with around 35 million rows. We are
I am developing an application using oracle 11g, Java(struts2) and Hibernate. I have table
I am using OracleCommand.Parameters in a select query for on an Oracle 11g database.
I want to make Java code (using Oracle 11g and JDBC also) which will

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.