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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T21:49:22+00:00 2026-06-11T21:49:22+00:00

I’m using Oracle 11g ( 11.1.0.7.0 ) and I have to create a XML

  • 0

I’m using Oracle 11g ( 11.1.0.7.0 ) and I have to create a XML File of a Query. I’m using this file in Forms 6, exactly the User want to be able to create the XML-File during press a button in the form, so I have an PL/SQL Package what create a CLOB File with the XML-Data on the Server and with Forms 6i I read this File line for line ( UTL_FILE.FOPEN to read it, UTL_FILE.GET_LINE for the lines ) and with TEXT_IO.PUT_LINE I write the File on the client computer.
This works wonderfull, but I have a problem with the XML-File.
Now it looks like this ( Values are examples! ):

<?xml version="1.0" encoding="ISO-8859-1" ?>
<ShoeShop>
  <Article>
    <Artnumber>12345</Artnumber>
    <Artdesc>Black Shoes</Artdesc>
  </Article>
  <Article>
    <Artnumber>12346</Artnumber>
    <Artdesc>White Shoes</Artdesc>
  </Article>
</ShoeShop>

ok.
I want to create an XML file that looks like the following, but I don’t know how! I’m new to SQL/PLSQL, I’m learning till 2 Months, before this I’ve used Progress 4GL. So in Progress I’ve called that what I want to do “nested”, but I don’t know how to realize it with SQL/PLSQL.
Example for the XML-File how I want to get it:

<?xml version="1.0" encoding="ISO-8859-1" ?>
<ShoeShop>
  <Article="12345">
    <Artdesc>Black Shoes</Artdesc>
  </Article="12345">
  <Article="12346">
    <Artdesc>White Shoes</Artdesc>
  </Article="12346">
</ShoeShop>

Code snippet for creating the XML-File how it looks like the first example:

PROCEDURE XML_TO_CLOB( pi_Query      IN VARCHAR2,
                       pi_ParentNode IN VARCHAR2,
                       pi_ChildNode  IN VARCHAR2 ) IS
  qryCtx DBMS_XMLGEN.ctxHandle;
  cResult CLOB;
BEGIN
-- Create new Context for the Query
  qryCtx := DBMS_XMLGEN.newContext( pi_Query );

-- Set Parent and Child Node
  DBMS_XMLGEN.setRowSetTag( qryCtx, pi_ParentNode );
  DBMS_XMLGEN.SetRowTag( qryCtx, pi_ChildNode );

-- setNullHandling to show Tag also when the value is NULL
  DBMS_XMLGEN.setNullHandling( qryCtx, DBMS_XMLGEN.EMPTY_TAG );

-- getXML in CLOB
  cResult := DBMS_XMLGEN.getXML( qryCtx );

-- Put encoding to the "Header"
  cResult := REPLACE( cResult, '<?xml version="1.0"?>', '<?xml version="1.0" encoding="ISO-8859-1" ?>' );

-- Close Context
  DBMS_XMLGEN.closeContext( qryCtx );

-- Write the CLOB to a file on the server to work with the data in Forms 6i
  DBMS_XMSLPROCESSOR.CLOB2FILE( cResult, 'ExampleDir', 'Example.xml' );
END;

Thanks a lot,

Sarah

  • 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-11T21:49:23+00:00Added an answer on June 11, 2026 at 9:49 pm

    There are some examples of using DBMS_XMLGEN to generate nested documents in the documentation. Check out example 17-27.

    The Oracle solution involves using user-defined types to specify the shape of the document, including columns which will be included as attributes rather than elements. This might be more infrastructure than you were expecting.

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

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
We are using XSLT to translate a RIXML file to XML. Our RIXML contains
I have a .ini file as follows: [playlist] numberofentries=2 File1=http://87.230.82.17:80 Title1=(#1 - 365/1400) Example
I have just tried to save a simple *.rtf file with some websites and
this is what i have right now Drawing an RSS feed into the php,
I want use html5's new tag to play a wav file (currently only supported
I have this code to decode numeric html entities to the UTF8 equivalent character.
I have a French site that I want to parse, but am running into
In my XML file chapters tag has more chapter tag.i need to display chapters
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this

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.