Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Stored Procedure Question
A copy of this was sent to Peter Daniels <peterd_at_snapsystems.com>
(if that email address didn't require changing)
On Wed, 28 Jul 1999 15:18:55 -0600, you wrote:
>That's awesome! Thanks. Will it work with ADO Recordsets?
>
not to my knowledge but my knowledge of ADO/RDO is about 0.
>Thomas Kyte wrote:
>
[snip]
>>
>> If you are trying to write a stored procedure that returns a result set then....
>>
>> it'll look like this:
>>
>> create or replace function sp_ListEmp return types.cursortype
>> as
>> l_cursor types.cursorType;
>> begin
>> open l_cursor for select ename, empno from emp order by ename;
>> return l_cursor;
>> end;
>> /
>>
>> With 7.2 on up of the database you have cursor variables. Cursor variables
>> are cursors opened by a pl/sql routine and fetched from by another application
>> or pl/sql routine (in 7.3 pl/sql routines can fetch from cursor variables as
>> well as open them). The cursor variables are opened with the privelegs of the
>> owner of the procedure and behave just like they were completely contained
>> within the pl/sql routine. It uses the inputs to decide what database it will
>> run a query on.
>>
>> Here is an example:
>>
[snip]
--
See http://govt.us.oracle.com/~tkyte/ for my columns 'Digging-in to Oracle8i'...
Current article is "Part I of V, Autonomous Transactions" updated June 21'st
Thomas Kyte tkyte_at_us.oracle.com Oracle Service Industries Reston, VA USA
Opinions are mine and do not necessarily reflect those of Oracle Corporation Received on Thu Jul 29 1999 - 06:37:22 CDT