oracle forms : timers

10
Working With Timers http:// blog.ebiztechnics.com

Upload: sekhar-byna

Post on 10-Feb-2017

563 views

Category:

Software


2 download

TRANSCRIPT

Page 1: Oracle Forms : Timers

Working With Timers

http://blog.ebiztechnics.com

Page 2: Oracle Forms : Timers

Objectives

• Describe Timer• Usage of timer• Create timer• Modify timer• Handle timer expiration• Delete timer

http://blog.ebiztechnics.com

Page 3: Oracle Forms : Timers

Timers

• What is a timer?A timer is an "internal time clock" that you programmatically createto perform an action each time the timer expires.

• Built-ins used:– FIND_TIMER– CREATE_TIMER– SET_TIMER– DELETE_TIMER– GET_APPLICATION_PROPERTY

(TIMER_NAME)

http://blog.ebiztechnics.com

Page 4: Oracle Forms : Timers

Usage of Timers

• WHEN-TIMER-EXPIRED Trigger.

• Using timers:– Periodically query, commit, or rollback– Show “About…” information at startup– Display ticker messages– Display running time

http://blog.ebiztechnics.com

Page 5: Oracle Forms : Timers

Handling Timer ExpirationStart

(R)

T1

When-Timer-Expired (A)Queryissued

Timer T2expired T2

Timer T1expired

(R)

T2,T1

CompletedWhen-Timer-Expired (T2)

When-Timer-Expired (T1)

Timer T1created

Timer T2created

Timer T1expired

http://blog.ebiztechnics.com

Page 6: Oracle Forms : Timers

Creating a Timer

• Syntax:

• Example:

CREATE_TIMER (timer_name, milliseconds, iterate)

v_timer_id := CREATE_TIMER (‘Time1’, 300,repeat);

http://blog.ebiztechnics.com

Page 7: Oracle Forms : Timers

Modifying a Timer

• Syntax:

• Example:

SET_TIMER (timer_name, milliseconds, iterate)SET_TIMER (timer_id, milliseconds, iterate)

SET_TIMER (‘Time1’, no_change, no_repeat);

http://blog.ebiztechnics.com

Page 8: Oracle Forms : Timers

Delete Timer

• Syntax:

DELETE_TIMER (timer_name)DELETE_TIMER (timer_id)

...IF NOT ID_NULL (FIND_TIMER (‘Time1’)) THEN

DELETE_TIMER (’Time1’);END IF;...

http://blog.ebiztechnics.com

Page 9: Oracle Forms : Timers

Find Timer Expiration

• Example:

IF GET_APPLICATION_PROPERTY(TIMER_NAME)=‘Time1’ THEN

Select . . . . .

From t1;

ELSE

:control.time_disp:=:SYSTEM.CURRENT_DATETIME;

END IF;

http://blog.ebiztechnics.com

Page 10: Oracle Forms : Timers

Summary

• Create and modify a timer with built-in functions– FIND_TIMER– CREATE_TIMER– SET_TIMER– DELETE_TIMER– GET_APPLICATION_PROPERTY

(TIMER_NAME)

http://blog.ebiztechnics.com