Writing a TRIGGER that basicly every time a sale IS over 100 it gives a 10% discount, but I keep getting errors AND hit a wall basicly , any help appeciated :)
{code}
CREATE OR REPLACE TRIGGER Date_Constraint_Trigger
before INSERT ON Sales_book
FOR EACH ROW
declare
discount exception;
begin
IF (:new.Scost > 100 ) then
raise discount;
end IF;
exception
when discount then
UPDATE
SET Sales_book.Scost = Sales_book.Scost * .9;
dbms_output.put_line('Discount Added.');
when others then rollback work;
end;
{code}