Timer Example In Oracle forms

Timer For Oracle forms 6i 9i 10g

The When-Timer-Expired trigger fires when a timer you have previously created in your form, expires.


For example, you create a timer in the when-button-pressed trigger of a button, like this:

DECLARE
timer_id Timer;
one_minute NUMBER(5) := 60000;
BEGIN
timer_id := CREATE_TIMER('emp_timer', one_minute, NO_REPEAT);
END;


60 seconds after the user presses the button, the When-Timer-Expired will fire, and its code will be executed.

When you create more than one timer, you need to check which of your timers expired, because the same trigger will fire, no matter which timer expired. You can use the GET_APPLICATION_PRPERTY built-in for that purpose.

Something like this:

Applied this on when-timer-expired trigger -----------------------

if get_application_property(TIMER_NAME) = 'EMP_TIMER' then
message('timer EMP_TIMER expired');
-- Do something else...
end if;

0 comments: