Can we use commit or rollback in trigger? If yes, then how. Please explain with a suitable example?

Answer Posted / nitinsharma06

Yes we can, the trigger will get compile also if you use commit inside it and that is without using PRAGMA AUTONOUMS TRANSACTION, but when you execute the DML operation it fails to execute.

So in compilation you won't get any error and while execute trigger will throw error.

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Why do we need unique key in a table?

521


Are stored procedures compiled?

522


Why do we need databases?

565


Is a secondary key the same as a foreign key?

487


Difference between table function and pipelined function?

583






What is the syntax to add a record to a table?

573


Can you have more than one trigger on a table?

530


what is the difference between truncate and drop statements? : Sql dba

550


Can we want to pass a parameter payroll_id to this external pl/sql function, how do we do it?

550


What is scalar function?

564


When is the update_statistics command used?

570


what is the different between now() and current_date()? : Sql dba

522


What is set transaction?

577


How to prepare for oracle pl sql certification?

568


What is pl/sql table? Why it is used?

556