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


Please Help Members By Posting Answers For Below Questions

What is openedge workgroup rdbms?

753


What you know in mapping of erd to dfd?

714


What is package in dbms?

655


What are the different types of modeling?

675


What is system catalog or catalog relation?

791






What is alternate key?

649


Which database is best for large data?

689


What is the 3-tier architecture?

663


What is rdbms architecture?

663


What is a relation schema?

661


What's the difference between clustered and non-clustered indexes?

673


Give us a non-computer example of preemptive and non-preemptive scheduling?

671


What is an optimization and performance tuning and how does it really work in practical projects?

647


what are the different kinds of indexing?

663


Is mysql a rdbms?

666