Solved

Using a timer with GET_APPLICATION_PROPERTY

Posted on 2001-08-22
2
1,369 Views
Last Modified: 2012-06-22
I'm using a timer (incorrectly), and in the WHEN-TIMER-EXPIRED trigger, I am getting this error:

"ORA-06502: PL/SQL: numeric or value error
Cause: An arithmetic, numeric, string, conversion, or constraint error occurred. For example, this error occurs if an attempt is made to assign the value NULL to a variable declared NOT NULL, or if an attempt is made to assign an integer larger than 99 to a variable declared NUMBER(2). "

I suspect I'm doing something wrong when I supply the name of the timer to GET_APPLICATION_PROPERTY.

The code to where I create the timer and also the WHEN-TIMER-EXPIRED code (where I suspect the trouble is) is directly below.

Thanks in advance.
-Brian

----------------------------------------
In my WHEN-NEW-FORM-INSTANCE trigger, I initialize a timer like this:

   TimerID := find_timer ('EDITTIMER');
   if not id_null (TimerID) then
      delete_timer (TimerID);
   end if;
   TimerID := create_timer ('EDITTIMER', 1000, REPEAT);
----------------------------------------
Then in my WHEN-TIMER-EXPIRED, I want to have some code execute when this timer fires, but I receive

declare
   CurTimer VARCHAR2(40) := Get_Application_Property ('EDITTIMER');
   x number;
begin
   if CurTimer = 'EDITTIMER' then
      x := show_alert ('test');
   end if;
end;
0
Comment
Question by:bek
2 Comments
 
LVL 3

Accepted Solution

by:
UsamaMunir earned 50 total points
ID: 6414845
Oh Mistake Mistake!

you will write it like this

CurTimer VARCHAR2(40) := Get_Application_Property (timer_name);

timer_name is a reserved word, u cant specify the exact name of the timer, this built-in will automaticaly give u the name of the MOST RECENTLY timer expired.



Cheerz
U
0
 

Author Comment

by:bek
ID: 6414868
Ah, I see you're right.  I misread the documentation. :(

Thank you very much for the help!

-Brian
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Note: this article covers simple compression. Oracle introduced in version 11g release 2 a new feature called Advanced Compression which is not covered here. General principle of Oracle compression Oracle compression is a way of reducing the d…
From implementing a password expiration date, to datatype conversions and file export options, these are some useful settings I've found in Jasper Server.
Via a live example, show how to restore a database from backup after a simulated disk failure using RMAN.
This video shows how to copy an entire tablespace from one database to another database using Transportable Tablespace functionality.

831 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question