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: Thomas L. Harleman <tharleman_at_iquest.net>
Date: Thu, 1 Jun 2000 08:47:15 -0500
Message-Id: <10515.107388@fatcity.com>


Where did you get the variable "ret_csr" to pass to child1 and child2?

> IF value = 1
> THEN
> child1(ret_csr);
> ELSE
> child2(ret_csr);
> END IF;
Tom Harleman
11080 Willowmere Dr.
Indianapolis, IN 46280
317-844-2884 Home
317-843-9122 Home Office

ThinkFast CONSULTING, Inc. (formerly Pinnacle Solutions) Technical Consultant
3500 DePauw Blvd. Suite 2071
Indianapolis, IN 46268
tharleman_at_thinkfast.com
317-334-1317 Office
317-334-1301 Fax

-----Original Message-----
From: root_at_fatcity.com [mailto:root_at_fatcity.com]On Behalf Of Shawn Ferris
Sent: Wednesday, May 31, 2000 1:40 PM
To: Multiple recipients of list ORACLE-L Subject: RE: Packages passing REF CURSOR between procedures:

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;
> END child2;
>
> END test;
> /

-- 
Author: Shawn Ferris
  INET: Shawn.Ferris_at_twtelecom.com

Fat City Network Services    -- (858) 538-5051  FAX: (858) 538-5051
San Diego, California        -- Public Internet access / Mailing Lists
--------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message
to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from).  You may
Received on Thu Jun 01 2000 - 08:47:15 CDT

Original text of this message

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