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 -> Re: stored procedure/function return SQL?

Re: stored procedure/function return SQL?

From: Daniel Morgan <damorgan_at_x.washington.edu>
Date: Mon, 16 Aug 2004 17:52:26 -0700
Message-ID: <412156CA.5030004@x.washington.edu>


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

Original text of this message

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