Is it possible to use Transactional control statements in
Database ?
Answer Posted / ddrema
It's posible and mandatory if you use AUTONOMOUS
TRANSACTION in the TRIGGER.
like this:
CREATE OR REPLACE TRIGGER audit_sal
BEFORE UPDATE OF salary ON employees FOR EACH ROW
DECLARE
PRAGMA AUTONOMOUS_TRANSACTION;
BEGIN
INSERT INTO emp_audit VALUES( :old.employee_id, SYSDATE,
:new.salary, :old.salary );
COMMIT;
END;
/
| Is This Answer Correct ? | 2 Yes | 0 No |
Post New Answer View All Answers
What are the different types of keys in database?
What is domain in dbms?
What is the purpose of database management system?
How to schedule ssas database backup
Define primary and unique key?
Explain what is a deadlock and mention how it can be resolved?
What is dbms function?
Is the server accepting tcp ip connections on port 5432?
What is service based database?
Who is end user in database?
Explain 2nf?
Can files be stored in a database?
What is 1nf 2nf 3nf in dbms?
How to detect the server version?
What are the importance of database in banking?