Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Cursors
EXAMPLE:
cursor c1 (inp_date DATE, inp_ok VARCHAR2)
select ...
from ...
where date_field = decode(inp_ok, 'Y', inp_date, SYSDATE);
Evaluate dates, if OK pass 'Y' to the cursor with the date else pass 'N'
amerar_at_ci.chi.il.us wrote:
>
> Hello,
>
> I have a question about cursors. I want to define a cursor based upon
> parameters passed into my PL/SQL program.
>
> I want to look at the parameters the user passes in. If they are valid
> dates, I want to use those dates in my WHERE caluse. Otherwise, I want
> to use SYSDATE.
>
> How can I code a 'conditional' define for a CURSOR since it is done in
> the declaration section??
>
> Thanks,
>
> Arthur
> amerar_at_ci.chi.il.us
>
> PS. Please cc a copy to e-mail.
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.
Received on Tue Nov 16 1999 - 08:38:53 CST