Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: trigger syntax for after insert
It is an ORA-04082 and the reason is reported quite clearly in the
error message itself:
SQL> CREATE OR REPLACE TRIGGER AFT_IN_TEAMS
2 AFTER INSERT ON EMP
3
4 BEGIN
5 IF :NEW.Deptno = 1 THEN
6 INSERT INTO DEPT (DEPTNO,DNAME) VALUES ( 7 :NEW.Deptno, 8 'Dept ' || :NEW.Deptno) 9 ;
*
So make it a row level trigger, as probably intended:
SQL> CREATE OR REPLACE TRIGGER AFT_IN_TEAMS
2 AFTER INSERT ON EMP
3 FOR EACH ROW
4 BEGIN
5 IF :NEW.Deptno = 1 THEN
6 INSERT INTO DEPT (DEPTNO,DNAME) VALUES ( 7 :NEW.Deptno, 8 'Dept ' || :NEW.Deptno) 9 ;
Trigger is aangemaakt.
Regards,
Rob.
Received on Mon Jul 02 2007 - 03:25:33 CDT
![]() |
![]() |