|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
1200+ fellow developers rate and compare features of the top IDEs, like Visual Studio, Eclipse, RAD, Delphi and others, across 13 categories. Enjoy this FREE Download of the IDE User Satisfaction Study by Evans Data Corporation. Download Now!
|
|
#1
|
|||
|
|||
|
Hello all,
I was wanting to implement a trigger that implemented an action after an update on a table. Currently I have this: CREATE TRIGGER oTrigger AFTER UPDATE ON orders WHEN (paymentStatus NOT null AND deliveryStatus NOT NULL) FOR EACH ROW BEGIN INSERT INTO storedAt VALUES (new.PID, new.WID, new.Number) END I get the following error: "WHEN clause cannot be used with table level triggers" Bascially I want to perform the trigger action on the updated tuple only (only one will be updated per update statement). What is my problem here, and how should I go about this? Thanks for your help Chris |
|
#2
|
|||
|
|||
|
Something like:
Code:
CREATE TRIGGER oTrigger AFTER UPDATE ON orders
FOR EACH ROW
BEGIN
if (new.paymentStatus is NOT NULL AND new.deliveryStatus IS NOT NULL)
INSERT INTO storedAt VALUES (new.PID, new.WID, new.Number)
END IF;
END
|
![]() |
| Viewing: Dev Shed Forums > Databases > Oracle Development > Simple Triggers |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|