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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T20:57:56+00:00 2026-06-17T20:57:56+00:00

I am working on oracle database 9ir2 I need to convert some tables into

  • 0

I am working on oracle database 9ir2
I need to convert some tables into xml files with custom format tags.

for example:
I want to generate XML from some columns in emp table then generate a file with name “myxmlfile.xml” as following:

<?xml version="1.0" encoding="UTF-8"?>
<entity-engine-xml>
 <myxmlfile
  EMPNO="8401"
  ENAME="JHON"
  HIREDATE="1988-12-30"
  SAL="5000"
  DEPTNO="10"

 />
 <myxmlfile
    ...
 />
 <myxmlfile
    ...
 />
</entity-engine-xml>
  1. how to generate custom XML file with tags as above, and everytime the user need to do so, in other words “per user request” by using pl/sql, how to use oracle XML functions to output customized desired tags?.
  2. how to convert xmltype to varchar2 ??? … to_char() function is unable to convert XMLtype to char.
  3. what is the easiest way to create XML file on client side ?

note: the user application is running on XP PCs, built by old oracle developer tools forms6i.

  • 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-17T20:57:57+00:00Added an answer on June 17, 2026 at 8:57 pm

    you do this with XMLELEMENT etc.

    select xmlelement("entity-engine-xml",
                      xmlagg(
                        xmlelement(
                          "myxmlfile", 
                          xmlattributes(empno as "EMPNO",
                                        ename as "ENAME",
                                        to_char(hiredate, 'yyyy-mm-dd') as "HIREDATE",
                                        sal as "SAL",
                                        deptno as "DEPTNO"
                                        )
                        )
                      )
                     ).getclobval()
      from emp;
    

    .

    how to convert xmltype to varchar2 ???
    

    theres a getStringVal function for this. i.e see in my example above i used getClobval. there’s a getstringval() equivalent.

    EDIT:
    spooling:

    set trims on feedback off heading off long 50000 linesize 32767 pagesize 0
    col c format a32767
    spool c:\temp\foo.xml
    select xmlelement("entity-engine-xml",
                      xmlagg(
                        xmlelement(
                          "myxmlfile", 
                          xmlattributes(empno as "EMPNO",
                                        ename as "ENAME",
                                        to_char(hiredate, 'yyyy-mm-dd') as "HIREDATE",
                                        sal as "SAL",
                                        deptno as "DEPTNO"
                                        )
                        )
                      )
                     ).transform(xmltype('<xsl:stylesheet version="1.0"
     xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
     <xsl:output omit-xml-declaration="yes" indent="yes"/>
     <xsl:template match="node()|@*">
      <xsl:copy>
       <xsl:apply-templates select="node()|@*"/>
      </xsl:copy>
     </xsl:template>
    </xsl:stylesheet>')) c
      from emp;
    spool off
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a working custom UserNamePasswordValidator that calls into my Oracle DB. This class
I'm working with an oracle database and what I basically need to do is
I am working with an Oracle 10g Database. I have the following two tables:
I am working on a project where (small) XML files need to lead to
I'm working on an oracle database which has a package with some stored procedures
I am working with an Oracle database and I need to be able to
I’m currently working on a classic ASP project talking to an Oracle database. I’m
I'm working on a web interface for modifying Oracle database backup settings. One of
Can anyone provide a working sample code to convert following Oracle DB table with
I am working through the example from https://blogs.oracle.com/arungupta/entry/java_ee_6_and_nosql . Here is a link to

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.