Home » Developer & Programmer » JDeveloper, Java & XML » XML file generation (Oracle 11g)
XML file generation [message #663574] Thu, 08 June 2017 12:36 Go to next message
Messages: 49
Registered: March 2015

I have to submit a document in XML format. I was also given a schema to work with but not sure how to apply it.
Our data is stored in an oracle database and sql queries are usually done on PL/SQL developer to retrieve output in excel format.
However i need output in xml format. How do i do this?
I understand that i can include items like the below..but how do i get the output in xml and how do i integrate the schema provided.

, department_name
FROM departments
WHERE department_id IN (10, 20);

Your assistance will be greatly appreciated.
Re: XML file generation [message #663575 is a reply to message #663574] Thu, 08 June 2017 14:18 Go to previous message
Michel Cadot
Messages: 68658
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator

Here's of what you can do:
SQL> select dbms_xmlquery.getxml('select * from emp where rownum <= 3') from dual;
<?xml version = '1.0'?>
   <ROW num="1">
      <HIREDATE>12/17/1980 0:0:0</HIREDATE>
   <ROW num="2">
      <HIREDATE>2/20/1981 0:0:0</HIREDATE>
   <ROW num="3">
      <HIREDATE>2/22/1981 0:0:0</HIREDATE>
Previous Topic: Converting XML Data to Rows.
Next Topic: unload the data from the Oracle database into xml, using java.
Goto Forum:

Current Time: Thu May 30 02:27:58 CDT 2024