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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T04:58:16+00:00 2026-06-09T04:58:16+00:00

I have no idea how to explain but I will try my best. I

  • 0

I have no idea how to explain but I will try my best. I am using Oracle Apex and have XML in my table called “CLOBTABLE” with datatype Clob. I have tried XMLTYPE as a datatype but its not accepting any data in apex, so i am using CLOB Currently as a data type. now i want to use data which is in xml form i.e.

<Row>
    <cellArray>
        <Cell>
            <columnId>1</columnId>
            <valueArray>
                <Value>
                    <value>IR000024575452</value>
                </Value>
            </valueArray>
        </Cell>
        <Cell>
            <columnId>5</columnId>
            <valueArray>
                <Value>
                    <value>AZ12579856-001</value>
                </Value>
            </valueArray>
        </Cell>
        <Cell>
            <columnId>2</columnId>
            <valueArray>
                <Value>
                    <value>IT06686</value>
                </Value>
            </valueArray>
        </Cell>
        <Cell>
            <columnId>9</columnId>
            <valueArray>
                <Value>
                    <value>Hu Mics Metab K</value>
                </Value>
            </valueArray>
        </Cell>
        <Cell>
            <columnId>8</columnId>
            <valueArray>
                <Value>
                    <value>2006-03-31</value>
                </Value>
            </valueArray>
        </Cell>
        <Cell>
            <columnId>7</columnId>
            <valueArray>
                <Value>
                    <value>2006-07-27</value>
                </Value>
            </valueArray>
        </Cell>
    </cellArray>
</Row>
<Row>
    <cellArray>
        <Cell>
            <columnId>1</columnId>
            <valueArray>
                <Value>
                    <value>IR000024575452</value>
                </Value>
            </valueArray>
        </Cell>
        <Cell>
            <columnId>5</columnId>
            <valueArray>
                <Value>
                    <value>AZ12579856-001</value>
                </Value>
            </valueArray>
        </Cell>
        <Cell>
            <columnId>2</columnId>
            <valueArray>
                <Value>
                    <value>IT06686</value>
                </Value>
            </valueArray>
        </Cell>
        <Cell>
            <columnId>9</columnId>
            <valueArray>
                <Value>
                    <value>Hu Mics Metab K</value>
                </Value>
            </valueArray>
        </Cell>
        <Cell>
            <columnId>8</columnId>
            <valueArray>
                <Value>
                    <value>2006-03-31</value>
                </Value>
            </valueArray>
        </Cell>
        <Cell>
            <columnId>7</columnId>
            <valueArray>
                <Value>
                    <value>2006-07-27</value>
                </Value>
            </valueArray>
        </Cell>
    </cellArray>
</Row>

and want to parse this data and insert it in another table called “Hyp”. each data corresponds to the column id of the database table and rest are the column values. i have tried Oracle XMLTYPE parser which is

DECLARE
    indoc    VARCHAR2(2000);
    indomdoc DBMS_XMLDOM.DOMDocument;
    innode   DBMS_XMLDOM.DOMNode;
    myparser DBMS_XMLPARSER.parser;
    buf      VARCHAR2(2000);
BEGIN
    indoc := '<emp><name>De Selby</name></emp>';
    myParser := DBMS_XMLPARSER.newParser;
    DBMS_XMLPARSER.parseBuffer(myParser, indoc);
    indomdoc := DBMS_XMLPARSER.getDocument(myParser);
    innode := DBMS_XMLDOM.makeNode(indomdoc);
    DBMS_XMLDOM.writeToBuffer(innode, buf);
    DBMS_OUTPUT.put_line(buf);
    DBMS_XMLDOM.freeDocument(indomdoc);
    DBMS_XMLPARSER.freeParser(myParser);
END;

but now i want to instead of using static content i.e. De Selby give dynamic content i.e. from that “CLOBTABLE” xml is given, data is parsed and inserted into “Hyp” table. I don’t know how to do it. Any help will be greatly appreciated.

  • 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-09T04:58:18+00:00Added an answer on June 9, 2026 at 4:58 am

    apex.oracle.com has the last apex version and db version (which is 11gR2 atm). This allows usage of xmltables.

    Please note that i had to wrap the data in tags to have valid xml (otherwise it would take as the main element, doesn’t parse)

    DECLARE
    l_xmlclob CLOB := 
    '<data>
    <Row>
      <cellArray>
        <Cell>
          <columnId>1</columnId>
          <valueArray>
            <Value>
              <value>IR000024575452</value>
            </Value>
          </valueArray>
        </Cell>
        <Cell>
          <columnId>5</columnId>
          <valueArray>
            <Value>
              <value>AZ12579856-001</value>
            </Value>
          </valueArray>
        </Cell>
      </cellArray>
    </Row>
    <Row>
      <cellArray>
        <Cell>
          <columnId>1</columnId>
          <valueArray>
            <Value>
              <value>IR000024575452</value>
            </Value>
          </valueArray>
        </Cell>
        <Cell>
          <columnId>5</columnId>
          <valueArray>
            <Value>
              <value>AZ12579856-001</value>
            </Value>
          </valueArray>
        </Cell>
      </cellArray>
    </Row>
    </data>';
    BEGIN
       FOR r IN (  SELECT rownum rn, cells
                   FROM xmltable('/data/Row' passing XMLTYPE(l_xmlclob)
                                             columns CELLS  XMLTYPE PATH './cellArray')
                )
       LOOP
          DBMS_OUTPUT.PUT_LINE('Row: '||r.rn);      
    
          FOR c IN ( SELECT colid, colval
                       FROM xmltable('/cellArray/Cell' passing r.cells
                                                       columns COLID NUMBER PATH './columnId',
                                                               COLVAL VARCHAR(20) PATH './valueArray/Value/value')
                   )
          LOOP
             DBMS_OUTPUT.PUT_LINE('colid, col value: '||c.colid||', '||c.colval);
          END LOOP;
       END LOOP;
    END;
    

    Output:

    Row: 1
    colid, col value: 1, IR000024575452
    colid, col value: 5, AZ12579856-001
    Row: 2
    colid, col value: 1, IR000024575452
    colid, col value: 5, AZ12579856-001
    

    Say that if you want actual columns, you could try this:

       FOR r IN (  SELECT rownum rn, cells
                   FROM xmltable('/data/Row' passing XMLTYPE(l_xmlclob)
                                             columns CELLS  XMLTYPE PATH './cellArray')
                )
       LOOP
          DBMS_OUTPUT.PUT_LINE('Row: '||r.rn);
    
          FOR c IN ( SELECT col1, col2, col3, col4, col5, col6
                       FROM xmltable('/cellArray/Cell' passing r.cells
                                                       columns COL1 VARCHAR(20) PATH './valueArray/Value/value[//columnId[contains(text(), "1")]]',
                                                               COL2 VARCHAR(20) PATH './valueArray/Value/value[//columnId[contains(text(), "2")]]',
                                                               COL3 VARCHAR(20) PATH './valueArray/Value/value[//columnId[contains(text(), "3")]]',
                                                               COL4 VARCHAR(20) PATH './valueArray/Value/value[//columnId[contains(text(), "4")]]',
                                                               COL5 VARCHAR(20) PATH './valueArray/Value/value[//columnId[contains(text(), "5")]]',
                                                               COL6 VARCHAR(20) PATH './valueArray/Value/value[//columnId[contains(text(), "6")]]'
                                                       )
                   )
          LOOP
             DBMS_OUTPUT.PUT_LINE('col values: col1: '||c.col1||', col2: '||c.col2||', col3: '||c.col3||', col4: '||c.col4||', col5: '||c.col5||', col6: '||c.col6);
          END LOOP;
       END LOOP;
    

    Output:

    Row: 1
    col values: col1: IR000024575452, col2: , col3: , col4: , col5: , col6: 
    col values: col1: , col2: , col3: , col4: , col5: AZ12579856-001, col6: 
    Row: 2
    col values: col1: IR000024575452, col2: , col3: , col4: , col5: , col6: 
    col values: col1: , col2: , col3: , col4: , col5: AZ12579856-001, col6: 
    

    Just a note though: your values are a weird structure… valuearray>value>value? Value is wrapped in value, and why would a single cell have multiple values (array)? If this is the case, ever, in your xml, you’ll need to adapt.

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

Sidebar

Related Questions

I will try my best to explain this. I have an application that show
I will try to explain my problem clearly: I have two tables: document and
This is a bit tricky to explain, but I will do my best. Say
This seems to be a little hard to explain, but I will try my
I have this question. But it will be difficult for me to explain as
The question is a bit complicated so I will try and explain. I have
Anyone have idea how to pass value from iPhone application to the REST-Webservice using
I will try to explain as well as possible what I'm trying to do.
I have a scenario which is not easy to explain, but I am sure
I will try and explain exactly what I want to achieve first. Imagine two

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.