This discussion is archived
1 Reply Latest reply: Nov 13, 2013 11:58 AM by CraigB RSS

Creating timer problem in oracle forms

979801 Newbie
Currently Being Moderated

Hello,

        I am using oracle weblogic 10.3.5 with oracle forms 11g at windows 7.I am trying to make a trigger but getting frm 40738 argument 1 to builtin GET_APPLICATION_PROPERTY cant be null error. I am using code at when-new-form-Instance trigger:

declare

    timer_id TIMER;

    one_second number:=1000;

    st varchar2(100);

begin

    timer_id :=find_timer('CLOCK_TIMER');

    If not id_null(timer_id) then

        delete_timer('timer_id');

    else

        timer_id := CREATE_TIMER('CLOCK_TIMER',one_second,REPEAT);

        --timer_id:=create_timer('CLOCK_TIMER',one_second,repeat);

        st:=Get_application_property(TIMER_NAME);

        message(st);

        end if;

        select to_char(sysdate,'HH24:MI:SS') into :EVENTS.CURRENT_TIME from dual;

        exception when others then

        message(TO_CHAR(SQLCODE)||''||SQLERRM);       

    end;

and at  When-Timer-Expired trigger:

declare

    timer_name varchar2(30);

BEGIN

 

   timer_name := GET_APPLICATION_PROPERTY(TIMER_NAME);

 

IF  timer_name = 'CLOCK_TIMER' THEN

 

      SELECT  TO_CHAR(SYSDATE,'HH24:MI:SS')

 

      INTO   :EVENTS.CURRENT_TIME

 

      FROM   DUAL;

 

END IF;

 

   EXCEPTION WHEN OTHERS THEN

 

      MESSAGE(TO_CHAR(SQLCODE)||''||SQLERRM);

 

END;

        Thank You

regards

aaditya.

  • 1. Re: Creating timer problem in oracle forms
    CraigB Guru
    Currently Being Moderated

    The problem is that you have a local variable with the same name as the CONSTANT "TIMER_NAME".  Therefore, your call to GET_APPLICATION_NAME is passing the value of your Local Variable to the built-in instead of the value of the CONSTANT 'TIMER_NAME."

     

    declare
        timer_name varchar2(30);
    BEGIN
       timer_name := GET_APPLICATION_PROPERTY(TIMER_NAME);
    IF  timer_name = 'CLOCK_TIMER' THEN

     

    Change your code so your variable TIMER_NAME is unique (different) from the constant TIMER_NAME variable. A common programming standard prefix your variable names with the data time.  Following this concept, rename your variable to V_TIMER_NAME.

     

    Craig...

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points