Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Procedure multiple out parameters into a cursor

SeshuGiriAug 17 2013 — edited Aug 18 2013

Hi,

I have a procedure that returns multiple out parameters.  How do I combine those and return as a cursor?

Here is the procedure I use (modified for forums)

PROCEDURE SAMPLEPROCEDURE

(in_param1 IN NUMBER,

in_param2   IN VARCHAR2,

output_ONE   IN VARCHAR2,

output_TWO   IN VARCHAR2,

output_THREE   IN VARCHAR2,

output_FOUR   IN VARCHAR2,

output_FIVE   IN VARCHAR2,

output_SIX   IN VARCHAR2,

)

IS

BEGIN

      output_one := 'YAH!';

     SELECT count(*) into output_TWO FROM   tablea WHERE  tablea.columnB = in_param1;

     IF (variable1 = 0) THEN

        output_one := 'SOMETHING MISSING';

        RETURN;

     END IF;

      SELECT count(*) into CHECKINGACCOUNT_COUNT from ACCOUNT WHERE   TABLE = in_param1 AND  ACCOUNT.TYPE = 'CHECKING';

   IF  (CHECKINGACCOUNT_COUNT <> 0) then

  SELECT count(*) into output_THREE FROM   tableB WHERE  tableB.columnB = in_param1;

  SELECT columnC into output_FOUR FROM   tableC WHERE  tableC.columnC = in_param1;

  SELECT SUM(columnD) into output_FIVE FROM   tableD WHERE  tableD.columnD = in_param1;

   if(output_FIVE >= input_param2) then

  output_FIX := 'RETURN VALUE';

   end if;

  

END IF;

end SAMPLEPROCEDURE;

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Sep 15 2013
Added on Aug 17 2013
4 comments
1,506 views