| Oracle FAQ | Your Portal to the Oracle Knowledge Grid | |
Home -> Community -> Usenet -> c.d.o.server -> Help with a trigger
I have made a trigger like this...
declare
nom_de_taula varchar(30);
vegades number;
begin
SELECT table_name INTO nom_de_taula FROM all_tables
WHERE owner = 'DBAPROV' and
table_name = upper(:new.nom_taula);
if :new.cal_crear_sn = 'S' then
SELECT count(*) INTO vegades FROM control_taules_odd
WHERE entidad = :new.entidad and
nom_taula = upper(:new.nom_taula) and
cal_crear_sn = 'S';
if vegades >= 1 then
raise_application_error
(-20002, 'Una taula sols es pot crear en un
model');
end if;
end if;
exception
when no_data_found then
raise_application_error
(-20001, 'Taula ('||:new.nom_taula||') Inexistent');
end;
When the insert is ok, execution of the trigger works fine
1 row created.
but when the trigger make a 'raise_application_error' in the SqlPlus appears:
ORA-20001: Taula (YYYY) Inexistent ORA-06512: at "DBAPROV.CONTROL_ODD_TRIG", line 20 ORA-04088: error during execution of trigger 'DBAPROV.CONTROL_ODD_TRIG'
----------------------------------------------------------------------------
The first error is ok (ORA-20001), but why appears the errors ORA-06512 and ORA-04088 ??.
I works in ORACLE 7.3.3.4 on AIX machine.
TIA, Received on Thu Jan 08 1998 - 00:00:00 CST
![]() |
![]() |