What is sql trigger example?



What is sql trigger example?..

Answer / Hemant Pathak

Here's an example of an SQL trigger that enforces data integrity rules: CREATE TRIGGER ensure_salary_minimum AFTER INSERT ON employees FOR EACH ROW WHEN (NEW.salary < 30000) THEN RAISE_APPLICATION_ERROR(-20001, 'Salary must be at least $30,000'); This trigger enforces a minimum salary of $30,000 for new employees by raising an error if the inserted salary is less than that amount.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More SQL PLSQL Interview Questions

What is the different between Stored Procedure and Procedure?

7 Answers   Informatica, MIS,


i have doubt that any one tell ref cursor comes in sql pl/sql? pls clarify?

4 Answers   Tech Mahindra,


Will truncate release space?

1 Answers  


How to display the records between two range in Oracle SQL Plus?

1 Answers   MCN Solutions,


What is the difference between rollback and rollback to statements?

1 Answers  


What is the difference between delete, truncate and drop command?

1 Answers  


Is a foreign key always unique?

1 Answers  


What is clustered index in sql?

1 Answers  


Is time a data type in sql?

1 Answers  


What is a Mapplet?

1 Answers   Informatica,


Can we call procedure in select statement?

1 Answers  


How to raise user-defined exception with custom sqlerrm ?

1 Answers  


Categories