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

Home -> Community -> Usenet -> c.d.o.server -> Re: PL-SQL: Cursor definition with additional parameter ? reason/meaning ?

Re: PL-SQL: Cursor definition with additional parameter ? reason/meaning ?

From: Ed Prochak <edprochak_at_gmail.com>
Date: 26 Feb 2007 12:19:23 -0800
Message-ID: <1172521163.707612.81470@v33g2000cwv.googlegroups.com>


On Feb 22, 4:12 pm, Wern..._at_mail.org (Werner Mueller) wrote:
> I learned that a cursor definition in PL-SQL follows the schema:
>
> Curosr mycurosr is ...
>
> Now I found a couple of sample where the cursor definition is like
>
> Cursor mycursor (somevar VARCHAR2) is ....
>
> What does that parameter/variable defintion mean ?
> Sometimes even more 2 or 3 additional vars are defiend
>
> How can I use this variable.
> May I get an example on how to apply such a parameter.
>
> Werner

It declares a variable to use in the WHERE clause of the cursor. SO for example use
Cursor mycursor (somevar VARCHAR2) is
  select a,b,c from mytable where c=somevar ;

then you supply the parameter when you open the cursor open mycursor('the value for somevar');

simple enough? Look it all up in the PL/SQL manual.

   Ed Received on Mon Feb 26 2007 - 14:19:23 CST

Original text of this message

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