Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Mailing Lists -> Oracle-L -> RE: a simple xml output using stylsheet
Hi Rahul,
Have a look at http://otn.oracle.com/tech/xml and also 'Oracle Application Developers Guide - XML'. There is a utility called XSQL which does this for you. Here's an example of that utility cut from the above mentioned guide (for 8i):
declare
queryCtx DBMS_XMLquery.ctxType;
result CLOB;
begin
queryCtx := DBMS_XMLQuery.newContext('select * from emp');
result := DBMS_XMLQuery.getXML(queryCtx);
printClobOut(result);
DBMS_XMLQuery.closeContext(queryCtx); -- you must close the query handle..
end;
/
The printClobOut procedure is :
/CREATE OR REPLACE PROCEDURE printClobOut(result IN OUT NOCOPY CLOB) is
xmlstr varchar2(32767);
line varchar2(2000);
begin
xmlstr := dbms_lob.SUBSTR(result,32767);
loop
exit when xmlstr is null;
line := substr(xmlstr,1,instr(xmlstr,chr(10))-1);
dbms_output.put_line('| '||line);
xmlstr := substr(xmlstr,instr(xmlstr,chr(10))+1);
end loop;
end;
/
Hope that helps,
Regards,
Charu.
-----Original Message-----
From: ml-errors_at_fatcity.com [mailto:ml-errors_at_fatcity.com]On Behalf Of
rahul sharma
Sent: Monday, July 28, 2003 10:51 AM
To: Multiple recipients of list ORACLE-L
Subject: a simple xml output using stylsheet
dear list, can anyone please point me to a simple example of select * from
emp; query
and the output displayed in xml (using a simple stylesheet) ...
we have not been able to locate this on the net...
TIA
-Rahul
--
Please see the official ORACLE-L FAQ: http://www.orafaq.net
--
Author: Charu Joshi
INET: joshic_at_mahindrabt.com
Fat City Network Services -- 858-538-5051 http://www.fatcity.com San Diego, California -- Mailing list and web hosting services ---------------------------------------------------------------------To REMOVE yourself from this mailing list, send an E-Mail message to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing). Received on Mon Jul 28 2003 - 01:29:24 CDT
![]() |
![]() |