CREATE_TIMER Built-in
Description
Creates a new timer with the given name. You can indicate the interval and whether the timer should repeat upon expiration or execute once only. When the timer expires, Oracle Forms fires the When-Timer-Expired trigger.
Syntax
FUNCTION CREATE_TIMER
(timer_name VARCHAR2,
milliseconds NUMBER,
iterate NUMBER);
Built-in Type unrestricted function
Returns Timer
Enter Query Mode yes
Parameters
- timer_name
-
- Specifies the timer name of up to 30 alphanumeric characters. The name must
begin with an alphabetic character. The data type of the name is VARCHAR2.
-
- milliseconds
-
- Specifies the duration of the timer in milliseconds. The range of values
allowed for this parameter is 1 to 2147483648 milliseconds. Values > 2147483648
will be rounded down to 2147483648. Note that only positive numbers are allowed.
The data type of the parameter is NUMBER. See Restrictions below for more
information.
-
- iterate
-
- Specifies whether the timer should repeat or not upon expiration, and takes
the following constants as arguments:
-
- REPEAT Indicates that the timer should repeat upon expiration.
Default.
NO_REPEAT Indicates that the timer should not
repeat upon expiration, but is to be used once only, until explicitly called
again.
CREATE_TIMER Restrictions
- Values greater than 2147483648 will be rounded down to 2147483648.
- Milliseconds cannot be expressed as a decimal.
- No two timers can share the same name in the same form instance, regardless of case.
- If there is no When-Timer-Expired trigger defined at the execution of a timer, Oracle Forms returns an error.
- If there is no When-Timer-Expired trigger defined at the execution of a timer, and the timer is a repeating timer, subsequent repetitions are canceled, but the timer is retained.
- If there is no When-Timer-Expired trigger defined at the execution of a timer, and the timer is not a repeating timer, the timer is deleted.
CREATE_TIMER Examples
The following example creates a timer called EMP_TIMER, and sets it to 60 seconds and an iterate value of NO_REPEAT:
DECLARE
timer_id Timer;
one_minute NUMBER(5) := 60000;
BEGIN
timer_id := CREATE_TIMER('emp_timer', one_minute, NO_REPEAT);
END;