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 |
What is the different between Stored Procedure and Procedure?
i have doubt that any one tell ref cursor comes in sql pl/sql? pls clarify?
Will truncate release space?
How to display the records between two range in Oracle SQL Plus?
What is the difference between rollback and rollback to statements?
What is the difference between delete, truncate and drop command?
Is a foreign key always unique?
What is clustered index in sql?
Is time a data type in sql?
What is a Mapplet?
Can we call procedure in select statement?
How to raise user-defined exception with custom sqlerrm ?
Oracle (3253)
SQL Server (4518)
MS Access (429)
MySQL (1402)
Postgre (483)
Sybase (267)
DB Architecture (141)
DB Administration (291)
DB Development (113)
SQL PLSQL (3330)
MongoDB (502)
IBM Informix (50)
Neo4j (82)
InfluxDB (0)
Apache CouchDB (44)
Firebird (5)
Database Management (1411)
Databases AllOther (288)