CREATE OR REPLACE TRIGGER CHECK_ITEM_ACTUALPRICE
BEFORE INSERT OR UPDATE OF ACTUALPRICE ON ITEM
FOR EACH ROW
DECLARE
mprice number;
BEGIN
    SELECT minprice INTO mprice FROM price WHERE :old.prodid=prodid
    AND enddate IS NULL;
    IF(:new.actualprice<mprice) THEN
        raise_application_error(-20004, 'Aktueller Preis ist niedriger als
        Mindestpreis');
    END IF;
END;
/
