Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: stored procedure/function return SQL?
kaeli wrote:
> 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
>
Return a CLOB.
-- Daniel A. Morgan University of Washington damorgan_at_x.washington.edu (replace 'x' with 'u' to respond)Received on Mon Aug 16 2004 - 19:52:26 CDT
![]() |
![]() |