adspace


What is sql trigger example?

Answer Posted / 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       View All Answers


Please Help Members By Posting Answers For Below Questions

how many tables will create when we create table, what are they? : Sql dba

1144


If a cursor is open, how can we find in a pl/sql block?

1238


Is primary key always clustered index?

1095


define sql insert statement ? : Sql dba

1098


Does group by remove duplicates?

1112


how to start mysql server? : Sql dba

1267


what are aggregate and scalar functions? : Sql dba

1129


what are all the common sql function? : Sql dba

1131


what is collation? : Sql dba

1229


What is the current version of sql?

1094


Is primary key clustered index?

1019


what is sql server agent? : Sql dba

1182


Do we need to rebuild index after truncate?

1138


Hi am new to PLSQL & facing problems in writing code like in SP, Functions, so any one having some SP coding with in depth explanation please share with me my Email ID suvarnaatsuvarna@rediffmail.com Or taking tanning on this please do contact me

2091


How do I remove duplicates in two columns?

1187