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

Home -> Community -> Usenet -> c.d.o.server -> Re: function that returns a cursor

Re: function that returns a cursor

From: Ernest Morariu <ernest_at_gesora.com>
Date: Fri, 13 Aug 2004 17:44:18 +0200
Message-ID: <cfinkm$c1i$1@carabinieri.cs.interbusiness.it>


Many thanks Daniel !

Do you know if it possible to use such a procedure(like the "child" procedure) from the client applications using ADO 2.6 o ADO.NET ?

If yes, how should I call such procedure ?

ernest

"Daniel Morgan" <damorgan_at_x.washington.edu> wrote in message news:1092406133.554347_at_yasure...
> Ernest Morariu wrote:
>
> > Hi All !
> >
> > I want to create a function/procedure that takes some parameters, make
some
> > processing and finally return a resultset/cursor/table to the
client(ADO).
> >
> > My problem is that I don't know how to return the resultset. In the
> > documentation, all of the samples of procedures/functions show how to
> > insert/delete/update records but they do not show how to return
resultsets.
> >
> > I don't know what to declare as return type for a function returning a
> > resultset. Should I use a TableType ? a cursor ? a generic cursor ? a
> > record type ? a object row type with pipelined ?
> >
> > Consider I want to return a resultset having the following structure :
> > ID Number(16,0)
> > FirstName varchar2(30)
> > LastName varchar2(30)
> >
> > Help me to create a function like this:
> >
> > Create function GetMyData(prm varchar2) return <??????>
> > AS
> > BEGIN
> > -- doing some things
> >
> > /*
> > show me how to return the result of the following command to the client
:
> > SELECT ID, FirstName, LastName From MyTable Where FirstName Like prm
> > */
> >
> > END;
> >
> > Best regards,
> > ernest
>
> Return the result set with a REF CURSOR.
> http://www.psoug.org/reference/ref_cursors.html
>
> --
> Daniel A. Morgan
> University of Washington
> damorgan_at_x.washington.edu
> (replace 'x' with 'u' to respond)
>
Received on Fri Aug 13 2004 - 10:44:18 CDT

Original text of this message

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