Solved

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

Posted on 2008-06-13
4
1,204 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

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

Question has a verified solution.

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

Why doesn't the Oracle optimizer use my index? Querying too much data Most Oracle developers know that an index is useful when you can use it to restrict your result set to a small number of the total rows in a table. So, the obvious side…
This post first appeared at Oracleinaction  (http://oracleinaction.com/undo-and-redo-in-oracle/)by Anju Garg (Myself). I  will demonstrate that undo for DML’s is stored both in undo tablespace and online redo logs. Then, we will analyze the reaso…
This video shows how to copy a database user from one database to another user DBMS_METADATA.  It also shows how to copy a user's permissions and discusses password hash differences between Oracle 10g and 11g.
This video explains at a high level about the four available data types in Oracle and how dates can be manipulated by the user to get data into and out of the database.

726 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