• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1211
  • Last Modified:

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

folks

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

all help will do

r
0
rutgermons
Asked:
rutgermons
  • 2
1 Solution
 
MilleniumaireCommented:
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
 
MikeOM_DBACommented:
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
 
rutgermonsAuthor Commented:
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
 
MikeOM_DBACommented:
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

Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now