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: David Fitzjarrell <oratune_at_aol.com>
Date: Tue, 06 Feb 2001 00:34:59 GMT
Message-ID: <95ngri$srd$1@nnrp1.deja.com>

In our last gripping episode michael_gressman_at_my-deja.com wrote:
> 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/
>

The following:

 CURSOR GETMACHINES (machdta in varchar2) IS    SELECT DISTINCT MACH
   FROM WAFER.PLATE_INFO
   WHERE
   (FAC IS NOT NULL) AND
   (MACH_DATA = machdta);

should work. You may need to change the data type for machdta.

--
David Fitzjarrell
Oracle Certified DBA


Sent via Deja.com
http://www.deja.com/
Received on Mon Feb 05 2001 - 18:34:59 CST

Original text of this message

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