Solved

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

Posted on 2009-05-07
4
1,940 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 143

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 143

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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

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…
This post first appeared at Oracleinaction  (http://oracleinaction.com/undo-and-redo-in-oracle/)by Anju Garg (Myself). I  will demonstrate that undo for DML’s is stored both in undo tablespace and online redo logs. Then, we will analyze the reaso…
This video shows information on the Oracle Data Dictionary, starting with the Oracle documentation, explaining the different types of Data Dictionary views available by group and permissions as well as giving examples on how to retrieve data from th…
This video explains what a user managed backup is and shows how to take one, providing a couple of simple example scripts.

821 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