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: variable in a cursor

Re: variable in a cursor

From: Sybrand Bakker <postbus_at_sybrandb.demon.nl>
Date: Tue, 6 Feb 2001 01:12:22 +0100
Message-ID: <t7ug7cmnuo7501@beta-news.demon.nl>

cursor getmachines(p_mach_data in varchar2) is
select distinct mach
from wafer_plate_info
where fac is not null and mach_data = p_mach_data; -- always make sure your parameter name differs from any column name

Hth,
Sybrand Bakker, Oracle DBA

<michael_gressman_at_my-deja.com> wrote in message news:95nct1$pah$1_at_nnrp1.deja.com...
> I declare a cursor as follows:
>
> CURSOR GETMACHINES IS
> SELECT DISTINCT MACH
> FROM WAFER.PLATE_INFO
> WHERE
> (FAC IS NOT NULL) AND
> (MACH_DATA = "somevalue");
>
> The problem is I don't know what the "somevalue" value is until later
> in the sql block. Is there a way I can setup this cursor to accept a
> value that I will pass into it later?
>
> Thanks,
> Mike
>
>
> Sent via Deja.com
> http://www.deja.com/
Received on Mon Feb 05 2001 - 18:12:22 CST

Original text of this message

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