Solved

Using a timer with GET_APPLICATION_PROPERTY

Posted on 2001-08-22
2
1,362 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
Comment Utility
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
Comment Utility
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.

Join & Write a Comment

Cursors in Oracle: A cursor is used to process individual rows returned by database system for a query. In oracle every SQL statement executed by the oracle server has a private area. This area contains information about the SQL statement and the…
Configuring and using Oracle Database Gateway for ODBC Introduction First, a brief summary of what a Database Gateway is.  A Gateway is a set of driver agents and configurations that allow an Oracle database to communicate with other platforms…
This video shows how to recover a database from a user managed backup
This video shows how to copy an entire tablespace from one database to another database using Transportable Tablespace functionality.

763 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now