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;