CURSOR with multiple parameters

From: Slarti <1012-873_at_gmx.de>
Date: 18 Mar 2002 04:49:33 -0800
Message-ID: <ccb8e3b6.0203180449.77e35e0f_at_posting.google.com>


Hi guys,

i have only one simple question: Does this work?

Maybe one of you have experienced with this stuff, but i couldn't find anything about this specific topic in any book or Oracle documentation.

I will give an example and you'll know my intention.

Due to massively reusability i want to define a cursor like this:

CURSOR c1( par1 NUMBER DEFAULT NULL,

           par2 NUMBER DEFAULT NULL)
IS
  SELECT... Is it possible to use the DEFAULT key word like this?

This cursor may get par1 OR par2 OR both. Therefore i only want one cursor.

When opening and passing parameters to the cursor i would like to do it this way:

FOR c1_rec IN c1( par2 => v_num )
LOOP
...

Is this possible? I have to be flexible and involve one of two parameters a time. The => Operator could solve this, if it's appropriate.

I wouldn't like to call it with an explicit NULL, like ...c1(NULL, v_num)..., because it looks senseless and decreases readability. Received on Mon Mar 18 2002 - 13:49:33 CET

Original text of this message