Solved

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

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

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.

Question has a verified solution.

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

Have you ever had to make fundamental changes to a table in Oracle, but haven't been able to get any downtime?  I'm talking things like: * Dropping columns * Shrinking allocated space * Removing chained blocks and restoring the PCTFREE * Re-or…
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…
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 configure and send email from and Oracle database using both UTL_SMTP and UTL_MAIL, as well as comparing UTL_SMTP to a manual SMTP conversation with a mail server.

911 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

20 Experts available now in Live!

Get 1:1 Help Now