25 pts.
 Escalation module with Oracle 9i and Oracle Forms 6i
we are developing customer care software working on Escalation Module.Here my system should genrate an email to executive or techical head if complain doesn't get resolved within 3-hrs.i am using oracle 9i and forms 6i as frontend.i hv two points to be disscussed. 1). if complain occur at 10.00 am,so it should resolved by 1.00 pm. how do i calculate time difference between time limit and complain log in time.(pls write query) i am working on following query ,its giving me INVALID NO ERROR. * select to_char(sysdate,'hh24:mi:ss')-to_char(to_date(21-may-09),'hh24:mi:ss') from tablename; 2)shall i go for trigger for sending an email??? if yes which kind of trigger??? on which event???how?? pls guide me. i am new in oracle. thnx in advance. eagerly waiting for reply

Software/Hardware used:
ASKED: May 22, 2009  11:43 AM
UPDATED: May 23, 2009  6:15 AM

Answer Wiki:
Hello Firasha. You asked the same question a few days ago. If the answer provided was not useful, it would have been better to continue the discussion in the <a href="http://itknowledgeexchange.techtarget.com/itanswers/calculate-time-difference/">original question</a> instead of creating a new one. You are getting the INVALID NUMBER error because you are trying to perform an arithmetic operation between two varchar variables. To calculate time differences you need to have your time values in DATE columns, there is no need to convert them to varchars. Example: SELECT sysdate - complaint_log_time FROM your_table; If you want the result in hours, just convert it: SELECT (sysdate - complaint_log_time)*24 FROM your_table; To check whether the complaint was resolved at the time limit, you would need an application to keep monitoring the time limits for each complaint, or you could schedule a job, using the <a href="http://www.ldc.usb.ve/docs/ora9/DBAdminGuide/jobq.htm">DBMS_JOB</a> database package. A trigger won't work because triggers fire when something happens in the database, not when something does not happen. As for how to send the e-mail, a couple of links were provided in the answer to the <a href="http://itknowledgeexchange.techtarget.com/itanswers/calculate-time-difference/">original question</a>.
Last Wiki Answer Submitted:  May 22, 2009  2:15 pm  by  carlosdl   63,535 pts.
All Answer Wiki Contributors:  carlosdl   63,535 pts.
To see all answers submitted to the Answer Wiki: View Answer History.


Discuss This Question:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _


 

Thanks A lot for u r Valuable Guidance. As i am new with this site so i didn’t know the procedure of asking the question . so i am really sorry for that. i will keep in mind u r all suggestion. well, thnx once again .
its great help for me.

Thnx a lott,
Anjum.

 25 pts.