Solved

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

Posted on 2009-05-07
4
1,902 Views
Last Modified: 2013-12-07
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

0
Comment
Question by:axtur
  • 2
  • 2
4 Comments
 
LVL 142

Accepted Solution

by:
Guy Hengel [angelIII / a3] earned 500 total points
ID: 24323808
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
 

Author Comment

by:axtur
ID: 24323866
So will this change all the rows or just the new ones being updated/inserted ??
0
 
LVL 142

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 24323967
just those being inserted/updated.
0
 

Author Closing Comment

by:axtur
ID: 31578923
great, thank you
0

Featured Post

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article started out as an Experts-Exchange question, which then grew into a quick tip to go along with an IOUG presentation for the Collaborate confernce and then later grew again into a full blown article with expanded functionality and legacy…
Working with Network Access Control Lists in Oracle 11g (part 1) Part 2: http://www.e-e.com/A_9074.html So, you upgraded to a shiny new 11g database and all of a sudden every program that used UTL_MAIL, UTL_SMTP, UTL_TCP, UTL_HTTP or any oth…
Via a live example show how to connect to RMAN, make basic configuration settings changes and then take a backup of a demo database
This video shows how to copy a database user from one database to another user DBMS_METADATA.  It also shows how to copy a user's permissions and discusses password hash differences between Oracle 10g and 11g.

786 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question