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:
<pre>DECLARE
timer_id Timer;
one_minute NUMBER(5) := 60000;
BEGIN
timer_id := CREATE_TIMER('emp_timer', one_minute, NO_REPEAT);
END; </pre>
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:
if get_application_property(TIMER_NAME) = 'EMP_TIMER' then
<pre>if get_application_property(TIMER_NAME) = 'EMP_TIMER' then
message('timer EMP_TIMER expired');
-- Do something else...
end if;
</pre>
How can I get my WHEN-TIMER-EXPIRED command to fire while a host command is executing? I actually want to allow the user to abort the host command if he clicks an “abort” button, and I figured a Timer would be the best way to do that, but it appears that no form processing can occur until the HOST command finishes executing.
Problem:
–
In Forms 6i, Timer related trigger suspends working when a child form is CALLed/OPENed
Problem Detail:
–
Using Oracle Forms 6i….
Created timer triggers on ‘Main’ form.
Main form is some sort of MENU where button have been placed to call/open other forms.
Further I have 10 or even more forms to be called/opened from the main form.
Everything works fine as far as user is on the main form (not called/opend any form from ‘main’ form)
Problem starts when user clicks on any button and navigates to another form (I used CALL_FORM/OPEN_FORM to call/open the other forms).
Is there any solution in someone’s mind ? Early help will be regarded.
Regards.
Wasim
–put this in When New Form Instance trigger:DECLARETEM DATE;TIMER_ID TIMER;BEGIN SELECT SYSDATEINTO TEMFROM DUAL;SELECT TO_NUMBER(TO_CHAR(TEM, ‘HH’))||’:'||TO_NUMBER(TO_CHAR(TEM, ‘MI’))||’:'||TO_NUMBER(TO_CHAR(TEM, ‘SS’))INTO :digi_clockFROM DUAL;TIMER_ID := CREATE_TIMER(‘MY_TIMER’, 600, REPEAT);END;
–put this in when timer expired trigger:DECLARETEM DATE;TIMER_ID TIMER;BEGINSELECT SYSDATEINTO TEMFROM DUAL;SELECT TO_NUMBER(TO_CHAR(TEM, ‘HH’))||’:'||TO_NUMBER(TO_CHAR(TEM, ‘MI’))||’:'||TO_NUMBER(TO_CHAR(TEM, ‘SS’))INTO :digi_clockFROM DUAL;END;