Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

PL/SQL Cursor problem subtracting from dates 1

Status
Not open for further replies.

llmclaughlin

Programmer
Aug 20, 2004
140
US
With the below procedure, what I need to do in the cursor is find in the table where the call_date is less than sysdate by 30 minutes or more.
ANy suggestions

PROCEDURE CHECKESCALATE

IS

CURSOR L_Escalates
IS
SELECT CALL_DATE
FROM ESCALATE_CALLS
WHERE TO_CHAR(CALL_DATE, 'MM/DD/YYYY HH24:MI:SS') < TO_CHAR(SYSDATE, 'MM/DD/YYYY HH24:MI:SS')
AND ESCALATED = 'F';


BEGIN

FOR L_Escalated IN L_Escalates LOOP
EmailClient('L_SMTP');
END LOOP;


END CHECKESCALATE;
 
LL,

Replace "WHERE TO_CHAR(CALL_DATE, 'MM/DD/YYYY HH24:MI:SS') < TO_CHAR(SYSDATE, 'MM/DD/YYYY HH24:MI:SS')" with:
Code:
...WHERE CALL_DATE < SYSDATE-(1/24/60*30)...
Let us know if this does what you want.


[santa]Mufasa
(aka Dave of Sandy, Utah, USA)
[ Providing low-cost remote Database Admin services]
Click here to join Utah Oracle Users Group on Tek-Tips if you use Oracle in Utah USA.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top