Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: PL-SQL: Cursor definition with additional parameter ? reason/meaning ?
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
![]() |
![]() |