Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Passing date parameter to the cursor

user11290902Jul 29 2014 — edited Jul 29 2014


Hi Everyone,

I am trying to pass the date parameter to the cursor, but I'm unable to achieve this successfully. Could any of you please look and correct the code, awaiting for your response.

Here is the code >>>

        PROCEDURE DATAINSERTINTCRNR (itrns NUMBER) IS

                td date;

                status1 TABLE_CRMESSAGES.OBJID%TYPE;

                cursor t1(date2 date) is select objid from TABLE_CRMESSAGES where status='PENDING' and to_char(timestamp,'dd-MON-YY')='date2';

        BEGIN

                dbms_output.put_line('iteration number'||itrns);

                select to_date((sysdate-15),'dd-MON-YYYY') into td from dual;

                dbms_output.put_line('td is '||td);

                open t1(td);

                LOOP

                        fetch t1 into status1;

                        --EXIT WHEN t1%NOTFOUND;

                        dbms_output.put_line('Reaching here..');

                        dbms_output.put_line('status is: '||status1);

                END LOOP;

                close t1;

        END;

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Aug 26 2014
Added on Jul 29 2014
6 comments
1,770 views