Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Using old.fieldname in trigger

Using old.fieldname in trigger

From: Dale Sides <dsides_at_pciga.com>
Date: Mon, 11 Jan 1999 10:57:01 -0500
Message-ID: <369a1ede.0@newsman.viper.net>


I get an ora message indicating tablename or view does not exist when I try to compile the following trigger statement:

Declare

 v_Count_Total number;
 v_Total_Responded number;
 v_Total_Negative number;

Begin
 select count(*)
 into v_Count_Total
 from appnotifylist
 where appid=:old.AppID;

 select count(*)
 into v_Total_Responded
 from appnotifylist
 where appid=:old.AppID and responsedate is not null;

 if v_Count_Total = v_Total_Responded then

  select count(*)
  into v_Total_Negative
  from appnotifylist
  where appid=:old.AppID and approved='NO';

  if v_Total_Negative = 0 then

   update approvaldoc
   set approved='YES'
   where appid=:old.AppID;
   commit;

  else

   update approvaldoc
   set approved='NO'
   where appid=:old.AppID;
   commit;

  end if;

 else

 end if;

I am logged in as the schema owner so I do not need to indicate the schema name refrencing the tables. I can do a describe approvaldoc;
and a
describe appnotifylist;
in sqlplus and everything comes back normally.

Any ideas or responses will be greatly appreciated.

Thanks,
Dale Sides
dsides_at_pciga.com

end; Received on Mon Jan 11 1999 - 09:57:01 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US