Results 1 to 4 of 4
  1. #1
    Join Date
    Feb 2006
    Posts
    7

    Red face Unanswered: How to pass the date parameters to the cursor while opening....

    Dera Gurus,

    Help Required, it's a show stopper for me...

    create procedure emp
    (id number)

    --JOIN_DATE & SAL_DATE are DATE fields in EMP table.
    AS
    CURSOR DateCursor
    (
    c_id NUMBER,
    c_date emp.join_date%type
    )
    IS
    SELECT DISTINCT emp.join_date
    FROM emp e,
    dept d,
    salary s
    WHERE e.id=d.id
    AND e.join_date>sysdate-1
    AND e.sal_date <> c_date
    AND e.mgrflag= 'Y'
    ORDER BY e.join_date DESC;

    OPEN DateCursor (c_id, c_date);

    LOOP
    dbms_output.put_line ('entering loop');
    FETCH DateCursor
    INTO l_date;
    dbms_output.put_line (l_date);

    EXIT WHEN NOT DateCursor%FOUND;
    END LOOP;
    CLOSE DateCursor;
    END;


    Regards,
    Ashish

  2. #2
    Join Date
    Aug 2003
    Location
    Where the Surf Meets the Turf @Del Mar, CA
    Posts
    7,776
    Provided Answers: 1
    > it's a show stopper for me...
    It is for me too, because I don't know exactly with what you are having a problem?

    Why do you need the explicit cursor; as opposed to straight SQL & bind variables?

    Good Luck on your quest for answers.
    You can lead some folks to knowledge, but you can not make them think.
    The average person thinks he's above average!
    For most folks, they don't know, what they don't know.
    Good judgement comes from experience. Experience comes from bad judgement.

  3. #3
    Join Date
    Feb 2006
    Posts
    7
    >How to pass the date parameters to the cursor while opening....

    I am trying to fetch the c_date in l_date but not getting any value..
    Try to open the cursor by giving a variable of DATE type..
    The procedure compiles successfully but at runtime it's not fetching the value into l_date. That's where I am facing it.....

  4. #4
    Join Date
    Feb 2006
    Posts
    7
    The cursor willl be the main cursor and 4 cursors will be nested in it.
    C_DATE can have multiple values........

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •