Solved

oracle, database, 10, export table result set into xml

Posted on 2008-06-13
4
1,203 Views
Last Modified: 2013-12-19
folks

how do i export a table content in oracle into a batch xml format?

all help will do

r
0
Comment
Question by:rutgermons
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 16

Expert Comment

by:Milleniumaire
ID: 21778530
Use package DBMS_XMLGEN. This one very nicely converts contents of a table to XML. If you have hierarchy, use nested tables and Oracle objects.
0
 
LVL 29

Expert Comment

by:MikeOM_DBA
ID: 21778686
Try something like:

set pages 0 head off feed off long 32000 longc 32000
Select DBMS_XMLGEN.GETXML ('select empno,ename,job,deptno from emp')
  from dual;

Open in new window

0
 

Author Comment

by:rutgermons
ID: 21781269
thats mike

however how do i add a where clause into this query as when i run

Select DBMS_XMLGEN.GETXML ('select wonum from workorder where status ='COMP')
  from dual;

then i get a missing right parenthesis error

all help will do
0
 
LVL 29

Accepted Solution

by:
MikeOM_DBA earned 500 total points
ID: 21781471
To include single quotes in query, put them twice:

Select DBMS_XMLGEN.GETXML (
      'select wonum from workorder where status =''COMP''')
  from dual;

Open in new window

0

Featured Post

Secure Your Active Directory - April 20, 2017

Active Directory plays a critical role in your company’s IT infrastructure and keeping it secure in today’s hacker-infested world is a must.
Microsoft published 300+ pages of guidance, but who has the time, money, and resources to implement? Register now to find an easier way.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Oracle SQL - Query help 7 80
MULTIPLE DATE QUERY 15 103
Oracle function to insert records? 15 66
Oracle Nested table uses ? 2 46
Introduction A previously published article on Experts Exchange ("Joins in Oracle", http://www.experts-exchange.com/Database/Oracle/A_8249-Joins-in-Oracle.html) makes a statement about "Oracle proprietary" joins and mixes the join syntax with gen…
From implementing a password expiration date, to datatype conversions and file export options, these are some useful settings I've found in Jasper Server.
Video by: Steve
Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…
This video shows how to Export data from an Oracle database using the Original Export Utility.  The corresponding Import utility, which works the same way is referenced, but not demonstrated.

730 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question