Re: Developer2000: Timer event problem, pl. help!!!

From: <dmoyer_at_gpu.com>
Date: 1996/07/29
Message-ID: <4tidhv$gd7_at_nn2.fast.net>#1/1


In <4tgh3l$1o2_at_newsbf02.news.aol.com>, nvedula_at_aol.com (NVedula) writes:
>hi!
>Thanx in advance!!
>
>I have a WHEN-BUTTON-PRESSED trigger for a button in a base table block.
>The button's code basically reads like this:
>
>/* Create a repeating timer that expires every hour */
>DECLARE
> minute_timer TIMER;
> minute NUMBER(7):=60000; --i.e.one minute is 60000 milliseconds.
>BEGIN
> minute_timer:= CREATE_TIMER('alarm',minute,REPEAT);
>END;
>
>I have the following code in the WHEN-TIMER-EXPIRED trigger in Oracle
>forms45.
>
>what i am basically trying to do is this:
>Firstly, I am creating a timer using CREATE_TIMER built-in in a
>when-button-pressed trigger and then I am writing a when-timer-expired
>trigger to create another timer when the first one expires but this timer
>can be controlled by the end user for the Timer Name and Timer Interval
>are input by the user in a control item. so if user types in xxx in place
>of timer name(in a control item) and 30000 in place of timer interval
>(another control item) then a new timer with xxx as its name and 30000 as
>interval is created.
>
>
>DECLARE
> tm_id Timer;
> tm_interval NUMBER(7);
> Timer_Name varchar2 := :TIMER.TIMER_NAME;
> Timer_Intv NUMBER(7) := :TIMER.TIMER_INT;
>
>
>-- my inclusions, u can type something in a control item
>-- and use it in the following program as shown below.
>
>BEGIN
> /*
> ** User gives the interval in seconds, the timer routines
> ** expect milliseconds
> -- let user type in lets say 60 at Timer_Intv control item.
>-- tm_interval := 1000 * Timer_Intv;
> /* Lookup the timer by name */
>-- let user type the name alarm.
>-- tm_id := Find_Timer('Timer_Name');
> /* If timer does not exist, create it */
>-- IF Id_Null(tm_id) THEN
> tm_id := Create_Timer('Timer_Name', tm_interval, NO_REPEAT);
> message('Wow, this is working');
> /*
> ** Otherwise, just restart the timer with the new interval
> */
>-- ELSE
>
>-- Set_Timer(tm_id, tm_interval, NO_REPEAT);
>-- END IF;
>END;
>
>*********
>The problem that i have is that i get a value error on when-timer-expired
>trigger
>FRM 40735 which is basically the trigger raising an unhandled exception,
>in this case most probably WHEN value_error.
>
>Could someone please look into this and help? i don't think i have a
>value error since i am assigning the right values to all the variables.
>
>THANX A LOT!!!!!
>
>
>Naveen
>
>Pl. respond to nvedula_at_aol.com\

The offending statement is ---
  Timer_Name varchar2 := :TIMER.TIMER_NAME; Change it to ---
  Timer_Name varchar2(25) := :TIMER.TIMER_NAME;

It needs to have a size within PL/SQL.

D. Scott Moyer, Jr.                        dmoyer_at_gpu.com (preferred for work)
GPU Service Corporation                dsmoyer_at_enter.net (preferred for home)
Reading, PA Received on Mon Jul 29 1996 - 00:00:00 CEST

Original text of this message