"Error: ORA-04082: NEW or OLD references not allowed in table level triggers "

I'm getting this error when executing the next simple trigger
CREATE OR REPLACE
TRIGGER PASACOLOR
BEFORE INSERT OR UPDATE OF COLOR ON VENTAS
BEGIN
:NEW.COLOR := UPPER(:NEW.COLOR);
END PASACOLOR;

Open in new window

axturAsked:
Who is Participating?
 
Guy Hengel [angelIII / a3]Billing EngineerCommented:
you need to add FOR EACH ROW
CREATE OR REPLACE TRIGGER PASACOLOR
BEFORE INSERT OR UPDATE OF COLOR ON VENTAS
REFERENCING OLD AS OLD NEW AS NEW
FOR EACH ROW 
BEGIN
:NEW.COLOR := UPPER(:NEW.COLOR);
END PASACOLOR;

Open in new window

0
 
axturAuthor Commented:
So will this change all the rows or just the new ones being updated/inserted ??
0
 
Guy Hengel [angelIII / a3]Billing EngineerCommented:
just those being inserted/updated.
0
 
axturAuthor Commented:
great, thank you
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.