Home » RDBMS Server » Server Utilities » How to dump table into XML format?
How to dump table into XML format? [message #269829] Mon, 24 September 2007 15:18 Go to next message
BlackSwan
Messages: 25038
Registered: January 2009
Location: SoCal
Senior Member
Oracle V10.2.0.2 on Linux
My eventual goal is to dump an Oracle table into XML formatted file.

From AskTom I found:
http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:2432843988008
which says:
If you haven't already, you need to download and install the latest Oracle XML
Developer's Kits (XDK's). What you are trying to do is relatively simple, and with the
XDK, you can generate XML from SQL queries using PL/SQL, Java, C or C++. The following
command on the command line generates an XML document containing the first 4 rows of the
SCOTT.EMP table:

$ java OracleXML getXML -user "scott/tiger" "select * from emp where rownum < 5" > emp.xml

So I went to http://otn.oracle.com to obtain the XDK from:
http://www.oracle.com/technology/tech/xml/xdk/software/production10g/java_utilsoft.html#linux
Which says as follows:
Directions 
  Install  GNU gzip. 
  Download the Oracle XDK for Java in .tar format 
  Extract the distribution package into a directory. (Ex: #gzip -dc xdk.tar | tar xvf -) 
  The result should be the following files and directories:
 /bin - xdk executables and utilities 
 /nls/data - nls data files  
 /lib - directory for libraries 
 /xdk - top xdk directory 
 /xdk/demo - directory for demo files 
 /xdk/doc - directory for documentation  
 /xdk/admin - direcory for dband config files 
 /xdk/mesg - error message files  
 /xdk/*html. - doc navigation files 
 /xdk/license.html - copy of license agreement 


However what I found after completing the installation is as follows:
[root@dbx1 xml]# ls -l
total 16
drwxr-xr-x  2 47755 610 4096 Mar 17  2006 bin
drwxr-xr-x  2 47755 610 4096 Mar 17  2006 jlib
drwxr-xr-x  2 47755 610 4096 Mar 17  2006 lib
drwxr-xr-x  5 47755 610 4096 Apr  6  2006 xdk
[root@dbx1 xml]# 

Since what I got does not match what I was told to expect & since no file "OracleXML"
exists in this new directory tree, I am at a loss as to how best to proceed.

I'd appreciate a free clue on how to generate 1 file per Oracle table in XML format;
either with what I already have or that I cam easily obtain.

TIA
Re: How to dump table into XML format? [message #269840 is a reply to message #269829] Mon, 24 September 2007 16:42 Go to previous message
BlackSwan
Messages: 25038
Registered: January 2009
Location: SoCal
Senior Member
The answer is trivial once you know what to do.

select dbms_xmlquery.getxml('select * from scott.emp') from dual;
Previous Topic: Importing table in different database
Next Topic: Calling stored Procedure from SQL*LOADER
Goto Forum:
  


Current Time: Mon Dec 05 13:17:32 CST 2016

Total time taken to generate the page: 0.10944 seconds