thanks Charu, i have used this example successfully... but nowhere it's tell me how to use/attach a stylesheet
to format my XML output !!!
 
----- Original Message -----
Sent: Monday, July 28, 2003 1:29 PM
Subject: 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

-- set up the query context...!

queryCtx := DBMS_XMLQuery.newContext('select * from emp');

-- get the result..!

result := DBMS_XMLQuery.getXML(queryCtx);

-- Now you can use the result to put it in tables/send as messages..

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: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]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
[EMAIL PROTECTED]  or contact us on (62 21) 522 8775.
-------------------------------------------------------------------------------------------------------------------------------------------------------------
 
 

Reply via email to