Solved

Using a timer with GET_APPLICATION_PROPERTY

Posted on 2001-08-22
2
1,375 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

How to Create User-Defined Aggregates in Oracle Before we begin creating these things, what are user-defined aggregates?  They are a feature introduced in Oracle 9i that allows a developer to create his or her own functions like "SUM", "AVG", and…
Have you ever had to make fundamental changes to a table in Oracle, but haven't been able to get any downtime?  I'm talking things like: * Dropping columns * Shrinking allocated space * Removing chained blocks and restoring the PCTFREE * Re-or…
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
This videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function

713 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