Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

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

Posted on 2009-05-07
4
Medium Priority
?
2,215 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 143

Accepted Solution

by:
Guy Hengel [angelIII / a3] earned 2000 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

Enroll in October's Free Course of the Month

Do you work with and analyze data? Enroll in October's Course of the Month for 7+ hours of SQL training, allowing you to quickly and efficiently store or retrieve data. It's free for Premium Members, Team Accounts, and Qualified Experts!

Question has a verified solution.

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

Truncate is a DDL Command where as Delete is a DML Command. Both will delete data from table, but what is the difference between these below statements truncate table <table_name> ?? delete from <table_name> ?? The first command cannot be …
How to Create User-Defined Aggregates in Oracle Before we begin creating these things, what are user-defined aggregates?  They are a feature introduced in Oracle 9i that allows a developer to create his or her own functions like "SUM", "AVG", and…
Via a live example, show how to take different types of Oracle backups using RMAN.
This video explains what a user managed backup is and shows how to take one, providing a couple of simple example scripts.

604 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