create or replace TRIGGER TRIG_INSERT_UPDATE
BEFORE INSERT OR UPDATE OF L_SPACE,L_RENT
ON LOCATIONS FOR EACH ROW
DECLARE
temp_rent NUMBER;
BEGIN
IF (:new.L_SPACE)< 0 THEN
RAISE_APPLICATION_ERROR(-20100, 'Please insert a positive SPACE value');
END IF;
IF (:new.L_RENT)< 0 THEN
RAISE_APPLICATION_ERROR(-20100, 'Please insert a positive RENT value');
END IF;
temp_rent: =fn_calculate_rent(L_SPACE,L_RENTRATE);
UPDATE LOCATIONS
SET RENT=temp_rent;
END;
问问题
366 次