dbaspot
Tags Register FAQ Calendar Search Today's Posts Mark Forums Read

Quick Student Question - Oracle Database

This is a discussion on Quick Student Question - Oracle Database ; 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 ...


Home > Database Forum > Oracle Database > Quick Student Question

Reply

 

LinkBack Thread Tools Display Modes
  #1  
Old 04-28-2008, 10:52 PM
Database Newbie
 
Join Date: Apr 2008
Posts: 1
FlyinFungi is on a distinguished road
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 01:56 AM.