Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> stored procedure/function return SQL?
Hey all,
I'm just getting started with the whole stored procedure / function thing. I managed to get XML with a regular command-line query. I managed to get a result set (cursor) back from a stored function. How do I get the function to return XML?
Using Oracle 8i.
Here's what I have so far. [[ Edited for sensitive content. ]]
types.ref_cursor is a simple REF CURSOR (loosely typed).
create or replace function functionName (in_variableName IN varchar2)
return types.ref_cursor
as
t_Cursor types.ref_cursor;
begin
open t_Cursor for
select * from myTableName where theColumnName = in_variableName; return t_Cursor;
The cursor comes back fine, I just want XML instead of plain text. Any hints for me?
I tested the xmlgen.getxml function with this query and it works fine at the prompt. I just can't quite see how to get in the function.
TIA
-- -- ~kaeli~ Never say, "Oops!"; always say, "Ah, interesting!" http://www.ipwebdesign.net/wildAtHeart http://www.ipwebdesign.net/kaelisSpaceReceived on Mon Aug 16 2004 - 09:58:48 CDT