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

Home -> Community -> Usenet -> c.d.o.misc -> stored procedure/function return SQL?

stored procedure/function return SQL?

From: kaeli <tiny_one_at_NOSPAM.comcast.net>
Date: Mon, 16 Aug 2004 09:58:48 -0500
Message-ID: <MPG.1b8a87a1e0c9ad6998a049@nntp.lucent.com>

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;

end;

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/kaelisSpace
Received on Mon Aug 16 2004 - 09:58:48 CDT

Original text of this message

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