Solved

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

Posted on 2008-06-13
4
1,197 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
  • 2
4 Comments
 
LVL 16

Expert Comment

by:Milleniumaire
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Join & Write a Comment

Subquery in Oracle: Sub queries are one of advance queries in oracle. Types of advance queries: •      Sub Queries •      Hierarchical Queries •      Set Operators Sub queries are know as the query called from another query or another subquery. It can …
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…
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
This video shows how to configure and send email from and Oracle database using both UTL_SMTP and UTL_MAIL, as well as comparing UTL_SMTP to a manual SMTP conversation with a mail server.

744 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now