spacer

Webref WebRef   Sitemap · Experts · Tools · Services · Newsletters · About i.com

home / experts / xml / column81

XML Features of Oracle 8i and 9i

Developer News
Microsoft Shows Off Silverlight 4, IE9 Plans
Metasploit Expands Vulnerability Test Framework
HyperCard Reborn?

Examples and Code Snippets

Let's create some code after looking at the big picture.

XSU (=XML-SQL) Command line usage

XSU can be used via the command line, or via APIs for java and for PL/SQL.

Example:

java OracleXML getXML -user "scott/tiger" "select * from emp"

Given a table emp with the following structure:

EMPNO NUMBER,
ENAME VARCHAR2(20),
JOB VARCHAR2(20),
MGR NUMBER,
HIREDATE DATE,
SAL NUMBER,
DEPTNO NUMBER

XSU will output XML in this format

<?xml version=’1.0’?>
<ROWSET>
  <ROW num="1">
    <EMPNO>7369</EMPNO>
    <ENAME>Smith</ENAME>
    <JOB>CLERK</JOB>
    <MGR>7902</MGR>
    <HIREDATE>12/17/1980 0:0:0</HIREDATE>
    <SAL>800</SAL>
    <DEPTNO>20</DEPTNO>
  </ROW>
<!-- additional rows ... -->
</ROWSET>

Features:

Conversely, to insert XML:

java OracleXML putXML -user "scott/tiger" -fileName "/tmp/temp.xml" "emp"

where in this case temp.xml would be a valid XML file such as the example above.

XSU can also be called from Java...


Produced by Michael Claßen

internet.commediabistro.comJusttechjobs.comGraphics.com

Search:

WebMediaBrands Corporate Info

Legal Notices, Licensing, Permissions, Privacy Policy.
Advertise | Newsletters | Shopping | E-mail Offers | Freelance Jobs

webref The latest from WebReference.com Browse >
Rolling Out Your Own HTML Application Version Control · HTML 5: Client-side Storage · Working with Ajax Server Extensions
Sitemap · Experts · Tools · Services · Email a Colleague · Contact FREE Newsletters 
 The latest from internet.com
Wi-Fi Product Watch, November 2009 · Chip Market Recovering From '08 Collapse · Low-Cost Tools to Kickstart Your New Business

URL: http://www.webreference.com/xml/column81/2.html
Created: May 10, 2003
Revised: May 10, 2003