Quick Student Question

This is a discussion on Quick Student Question within the Oracle Database forums in category; Hi, I have a very easy student question. (Hope its easy!) I am trying to do the following... Before you update the PART table each row in that table with a warehouse equal to one set the price of that part to $100 CREATE OR REPLACE TRIGGER TRG_PART_UPDATE BEFORE UPDATE ON PART BEGIN UPDATE PART SET PRICE =100 WHERE WAREHOUSE=1; END; But if I make any sort of update such as. UPDATE PART SET PART_NUM ='AT99' WHERE PART_NUM ='AT91'; I get the following error... ORA-06512: at SYSTEM.TRG_PART_UPDATE , line 2 ORA-04088: error during execution of trigger 'SYSTEM....

Go Back   Database Forum > Oracle Database

Database Forums

Register FAQ Calendar Search Today's Posts Mark Forums Read
  #1  
Old 04-28-2008, 11:52 PM
Default Quick Student Question

Hi, I have a very easy student question. (Hope its easy!)

I am trying to do the following...
Before you update the PART table each row in that table with a warehouse equal to one set the price of that part to $100

CREATE OR REPLACE TRIGGER TRG_PART_UPDATE
BEFORE UPDATE ON PART
BEGIN
UPDATE PART
SET PRICE =100
WHERE WAREHOUSE=1;
END;

But if I make any sort of update such as.

UPDATE PART
SET PART_NUM ='AT99'
WHERE PART_NUM ='AT91';

I get the following error...

ORA-06512: at "SYSTEM.TRG_PART_UPDATE", line 2
ORA-04088: error during execution of trigger 'SYSTEM.TRG_PART_UPDATE'
ORA-06512: at "SYSTEM.TRG_PART_UPDATE", line 2
ORA-04088: error during execution of trigger 'SYSTEM.TRG_PART_UPDATE'
ORA-06512: at "SYSTEM.TRG_PART_UPDATE", line 2
ORA-04088: error during execution of trigger 'SYSTEM.TRG_PART_UPDATE'
ORA-06512: at "SYSTEM.TRG_PART_UPDATE", line 2
ORA-04088: error during execution of trigger 'SYSTEM.TRG_PART_UPDATE'
ORA-06512: at "SYSTEM.TRG_PART_UPDATE", li1. UPDATE PART
2. SET PART_NUM ='AT99'
3. WHERE PART_NUM ='AT91';

Is this because I am creating a recursive statement and it continually updates itself? I looked up the error message via google but it provides no help.

Thanks for any help!
Reply With Quote
Reply


Thread Tools
Display Modes



All times are GMT -4. The time now is 04:23 PM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Integrated by bbpixel2008 :: jvbPlugin R1013.368.1

Search Engine Friendly URLs by vBSEO 3.1.0
vB Ad Management by =RedTyger=
In an effort to better serve ads to our visitors, cookies are used on Mydatabasesupport.com. For more information, check out our Privacy Policy.