forms9 application

  Displaying a system timer

1.  form budgeting  WHEN_NEW_FORM_INSTANCE as follows :

 

declare

timer_id timer;

one_second number :=1000;

begin

timer_id :=find_timer(‘clock_timer’);

if not id_null(timer_id) then

delete_timer(timer_id);

else

timer_id :=create_timer(‘clock_timer’,one_second,repeat);

end if;

select to_char(sysdate,’hh24:mi:ss’) into :buttons.current_time  from dual;

exception when others then

message (‘error’);

message(to_char(sqlcode)||’ ‘||sqlerrm);

end;

 

2 .form WHEN-TIMER-EXPIRED trigger as fillows:

 

declare

timername varchar2(30);

begin

timername :=get_application_property(timer_name);

if  timername= ‘clock_timer’ then

select to_char(sysdate,’hh24:mi:ss’) into :buttons.current_time  from dual;

end if;

exception when others then

message(to_char(sqlcode)||’ ‘||sqlerrm);

end;                              

 

 

Advertisements
此条目发表在未分类分类目录。将固定链接加入收藏夹。

发表评论

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / 更改 )

Twitter picture

You are commenting using your Twitter account. Log Out / 更改 )

Facebook photo

You are commenting using your Facebook account. Log Out / 更改 )

Google+ photo

You are commenting using your Google+ account. Log Out / 更改 )

Connecting to %s