| Oracle FAQ | Your Portal to the Oracle Knowledge Grid | |
|  |  | |||
Home -> Community -> Usenet -> c.d.o.misc -> Re: Compiled Trigger throws error
Jürg Schaufelberger wrote:
> Hello
> 
> I work with oracle 8.1.7 and I wrote the following trigger and
> compiled it successfully:
> 
> CREATE OR REPLACE TRIGGER
>     AV_BB_EINZELPUNKT_EXAKTDEF
>     AFTER INSERT OR UPDATE OF ID_ART
>     ON AV_BB_EINZELPUNKT
>     FOR EACH ROW
>     BEGIN
>       IF :NEW.ID_ART IN (0) THEN
>          UPDATE AV_BB_EINZELPUNKT SET ID_EXAKTDEFINIERT = 0;
>       ELSE
>          UPDATE AV_BB_EINZELPUNKT SET ID_EXAKTDEFINIERT = 1;
>       END IF;
>     END;
> 
> then I executed the SQL statement:
> 
> UPDATE AV_BB_EINZELPUNKT set id_art = 0
> where fid = 1;
> 
> and got the following error
> 
> FEHLER in Zeile 1:
> ORA-04091: Tabelle AV_CHA.AV_BB_EINZELPUNKT wird gerade geändert,
> Trigger/Funktion darf es nicht sehen
> ORA-06512: in "AV_CHA.AV_BB_EINZELPUNKT_EXAKTDEF", Zeile 3
> ORA-04088: Fehler bei der Ausführung von Trigger
> 'AV_CHA.AV_BB_EINZELPUNKT_EXAKTDEF'
> 
> What's wrong ? Any idea ? Thanks for answers.
Look up "Mutating" and "Trigger"
You can not update a record in the table on which the trigger has been create.
-- Daniel A. Morgan http://www.psoug.org damorgan_at_x.washington.edu (replace x with u to respond)Received on Thu Sep 15 2005 - 14:17:44 CDT
|  |  |