I have to implement a trigger which would:
7) Show the DDL for how a trigger can be used to transfer all rental copies from a store being deleted from the Store information table to the central store
8) Show how this trigger can be extended to make sure that the central store is never deleted from the database
So far I have done this:
CREATE OR REPLACE TRIGGER stores
BEFORE DELETE ON stores
FOR EACH ROW
BEGIN
IF DELETING WHERE cvr = 123456789 THEN
Raise_Application_Error (
num => -20050,
msg => 'You can not delete Main Store.');
END IF;
IF DELETING THEN
UPDATE store_id=123456789 ON movies WHERE isActive = 0
END IF;
END;
so main store is with cvr which is written, but it gives me a compilation error. Any help? Thanks in advance.