| ORA-01403: no data found during execution of a trigger [message #121571] |
Mon, 30 May 2005 14:56  |
nicole bryan
Messages: 1 Registered: May 2005
|
Junior Member |
|
|
Hi Guys,
I've been using oracle sql for a while and I just ran into this problem. I keep getting ORA-01403: no data found when I try to update LAB using values that should work and values that shouldnt work.
Here's the trigger:
create or replace trigger checkcity
after insert or update of population on LAB
declare
cursor citypop is select * from COUNTRY;
totalpop COUNTRY.population%TYPE;
begin
for rec in citypop loop
select sum(population) into totalpop from LAB where
lower(country)=lower(rec.c_id) group by country;
if totalpop>rec.population then
raise_application_error(-20321,'Total of LAB population is greater than countrys population');
end if;
end loop;
end;
/
|
|
|
|
|
|