How do I create a timer that updates a field at a certain time?!
For example, if I want to create a digital clock that appears on my canvas .... I have the systems of system (System.Current_Datetime) ....
Every time I would have to be updating to get the time .... How do I do this?!
Timer
First, you need to create your timer. Where to create? (You decide this. It can be in pre-form, can be within a when-button-pressed, etc.)
there goes the steps:
later, you have to create a when-timer-expired trigger. In it you put the code that you want to shoot.
.
there goes the steps:
DECLARE
hour_timer TIMER;
one_hour NUMBER(7):=3600000; -- expira de hora em hora
BEGIN
--cria o timer "alarm", de uma hora (em mili-segundos)
--(pode ser Repeat ou NO_REPEAT)
hour_timer:= CREATE_TIMER('alarm',one_hour,REPEAT);
END;
later, you have to create a when-timer-expired trigger. In it you put the code that you want to shoot.
.
- Toad
- Rank: DBA Pleno
- Posts: 253
- Joined: Fri, 18 Nov 2005 2:14 pm
- Location: Seattle, WA
- Contact:
Matheus Gonçalves
matheus.dev
twitter.com/developer__c
matheus.dev
twitter.com/developer__c
An example to make use of the When-timer-expired:
That is, when it turns the timer, it updates the screen clock data .
DECLARE
tm_name VARCHAR2(40);
BEGIN
break;
tm_name := upper(Get_Application_Property(TIMER_NAME));
IF tm_name = 'ALARM' THEN
:agora := sysdate;
END IF;
END;
- alef
- Rank: Analista Pleno
- Posts: 119
- Joined: Tue, 06 Nov 2007 2:45 pm
- Location: Patos de Minas - MG
Alexandre Matos
Patos de Minas - MG
Do interior de Minas para o resto do Mundo
Patos de Minas - MG
Do interior de Minas para o resto do Mundo
Step-by-step tutorial for eventual research in the future.
First create the timer on the when-new-form-instance (or any other)
, then create a trigger when-timer- Expired at forms level that Toad used as an example and making some modifications.
First create the timer on the when-new-form-instance (or any other)
DECLARE
temporizador Timer;
T NUMBER(5) := 60000; -- 1 minuto
BEGIN
temporizador := CREATE_TIMER('tempo', T, REPEAT);
END;
DECLARE
tm_name VARCHAR2(40);
BEGIN
break;
tm_name := Get_Application_Property(TIMER_NAME);
IF tm_name = 'tempo' THEN
:Bloco.Relogio := sysdate; -- acerta a hora atual.
END IF;
END;
-
- Information
-
Who is online
Users browsing this forum: No registered users and 18 guests