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: Cursors

Re: Cursors

From: <masyedkasim_at_hotmail.com>
Date: Tue, 16 Nov 1999 15:27:23 GMT
Message-ID: <80rt4k$2to$1@nnrp1.deja.com>


You can declare a Cursor with a parameter. i.e.

Procedure .... ( date_parameter DATE ) IS

CURSOR Cur_Sample( your_date DATE ) IS
SELECT Col1,.... FROM The_Table WHERE
date_column = your_date

 ld_date DATE;

begin

   IF date_parameter is valid THEN

       ld_date := date_parameter;
   ELSE
       ld_date := SYSDATE;
   END IF;    OPEN Cur_Sample ( ld_date );
   FETCH ....
   CLOSE .... END; In article <80ro6k$uo0$1_at_nnrp1.deja.com>,   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.
>

Sent via Deja.com http://www.deja.com/
Before you buy. Received on Tue Nov 16 1999 - 09:27:23 CST

Original text of this message

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