Link to home
Start Free TrialLog in
Avatar of bek
bekFlag for United States of America

asked on

Using a timer with GET_APPLICATION_PROPERTY

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;
ASKER CERTIFIED SOLUTION
Avatar of UsamaMunir
UsamaMunir

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of bek

ASKER

Ah, I see you're right.  I misread the documentation. :(

Thank you very much for the help!

-Brian