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

Can we have two clustered index on a table?

662


What is pl sql and why it is used for?

678


Can instead of triggers be used to fire once for each statement on a view?

620


Is oracle and sql same?

667


What is rename command in sql?

544






How many developers work on postgresql?

656


Explain some predefined exceptions.

677


Explain the purpose of %type and %rowtype data types with the example?

638


how to increment dates by 1 in mysql? : Sql dba

635


What is sp_helptext?

684


What is the difference between pl and sql?

628


What is record in pl sql?

689


How do I delete a trigger?

629


what is a join? : Sql dba

665


What is write ahead logging in sql server?

654