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

Home -> Community -> Mailing Lists -> Oracle-L -> RE: Packages passing REF CURSOR between procedures:

RE: Packages passing REF CURSOR between procedures:

From: Shawn Ferris <Shawn.Ferris_at_twtelecom.com>
Date: Wed, 31 May 2000 11:34:53 -0600
Message-Id: <10514.107339@fatcity.com>


DOH! Got a bit carried away on the cut and paste.. (There should only be one package spec.)

Again, any and all help will be greatly appreciated!

Shawn M Ferris
Oracle DBA - Time Warner Telecom

> CREATE OR REPLACE PACKAGE test
> AS
>
> TYPE my_cursor IS REF CURSOR;
>
> procedure parent(value number);
> procedure child1(ret_csr IN OUT my_cursor);
> procedure child2(ret_csr IN OUT my_cursor);
>
> END test;
> /
>
> CREATE OR REPLACE PACKAGE BODY test
> AS
>
> PROCEDURE parent (value number)
> IS
> BEGIN
> IF value = 1
> THEN
> child1(ret_csr);
> ELSE
> child2(ret_csr);
> END IF;
>
> FOR record IN ret_csr LOOP
> dbms_output.put_line('Procedure: '||record.proc);
> END LOOP;
>
> END parent;
>
> PROCEDURE child1(ret_csr IN OUT my_cursor)
> IS
> BEGIN
> OPEN ret_csr FOR
> select 'child1' proc from dual;
> END child1;
>
> PROCEDURE child2(ret_csr IN OUT my_cursor)
> IS
> BEGIN
> OPEN ret_csr FOR
> select 'child2' proc from dual;
Received on Wed May 31 2000 - 12:34:53 CDT

Original text of this message

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