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

Explain ddl interpreter?

634


Can you explain fourth normal form and fifth normal form ?

494


What is database url?

516


What is pdo in database?

490


What is ordbms with example?

514






Enlist the advantages of dbms.

571


What do you understand by correlated subqueries in dbms?

561


Explain the difference between physical and logical data independence?

490


Can you drop all the columns of a table ?

540


What is the biggest advantage of rdbms?

522


What are database modules?

507


What is index hunting?

743


How does notification services work?

518


What are the limitations of rdbms?

532


What are database functions?

461