Tuesday, October 13, 2020

RDBMS PLSQL Program 45 program to generate before insert row trigger on emp table which will not allow salary less than 1000 using RAISE_APPLICATION_ERROR() function

CREATE OR REPLACE TRIGGER minSalary 

BEFORE INSERT ON emp

FOR EACH ROW

BEGIN

IF (:new.sal < 1000) THEN

RAISE_APPLICATION_ERROR (-20004, ‘Minimum Salary should be 1000’);

END IF;

END;

/


 


No comments:

Post a Comment

Thanks for showing your interest
I will shortly get back to you