Solved

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

Posted on 2009-05-07
4
1,870 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
Comment Utility
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
Comment Utility
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]
Comment Utility
just those being inserted/updated.
0
 

Author Closing Comment

by:axtur
Comment Utility
great, thank you
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Join & Write a Comment

Suggested Solutions

I remember the day when someone asked me to create a user for an application developement. The user should be able to create views and materialized views and, so, I used the following syntax: (CODE) This way, I guessed, I would ensure that useā€¦
Using SQL Scripts we can save all the SQL queries as files that we use very frequently on our database later point of time. This is one of the feature present under SQL Workshop in Oracle Application Express.
This video shows, step by step, how to configure Oracle Heterogeneous Services via the Generic Gateway Agent in order to make a connection from an Oracle session and access a remote SQL Server database table.
This video shows setup options and the basic steps and syntax for duplicating (cloning) a database from one instance to another. Examples are given for duplicating to the same machine and to different machines

771 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now