Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Mailing Lists -> Oracle-L -> RE: a simple xml output using stylsheet

RE: a simple xml output using stylsheet

From: Charu Joshi <joshic_at_mahindrabt.com>
Date: Sun, 27 Jul 2003 22:29:24 -0800
Message-ID: <F001.005C75FE.20030727222924@fatcity.com>


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





  The information contained in this email and its attachments if any may contain privileged and confidential information   intended only for the attention of the recipient(s) specified. If you are not a recipient , any forwarding , disclosure ,   photocopying , distribution or use of the information in any way is prohibited . If you have received this email in error ,   please email us immediately on info_at_infotech.co.id or contact us on (62 21) 522 8775.


--

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

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US