Is it possible to use Transaction control Statements such a
ROLLBACK or COMMIT in Database Trigger ? Why ?

Answers were Sorted based on User's Feedback



Is it possible to use Transaction control Statements such a ROLLBACK or COMMIT in Database Trigger ..

Answer / chintu

It is not possible. but if we want to put we use autonomous
transaction.

Is This Answer Correct ?    13 Yes 0 No

Is it possible to use Transaction control Statements such a ROLLBACK or COMMIT in Database Trigger ..

Answer / deva

yes we cannot make TCL commands with in triggers. If the
block is declared as a autonomous transaction, then commit
and rollback can be given in the end of the block

Is This Answer Correct ?    6 Yes 1 No

Is it possible to use Transaction control Statements such a ROLLBACK or COMMIT in Database Trigger ..

Answer / aravinda

We can't write COMMIT or ROLLBACK in triggers, because the
triggering event may commit or may not. trigger commit or
rollback is based on triggering event.

even we can't call a subprogram in a trigger which is having
commit or rollback.

but we can achieve through pragma autonomous transaction.

Is This Answer Correct ?    5 Yes 0 No

Is it possible to use Transaction control Statements such a ROLLBACK or COMMIT in Database Trigger ..

Answer / nishi

We can't write COMMIT or ROLLBACK in triggers, because the triggering event may commit or may not. trigger commit or rollback is based on triggering event.

even we can't call a subprogram in a trigger which is having commit or rollback.

but we can achieve through pragma autonomous transaction.

Is This Answer Correct ?    0 Yes 0 No

Is it possible to use Transaction control Statements such a ROLLBACK or COMMIT in Database Trigger ..

Answer / tulsi

It is not possible. As triggers are defined for each table,
if you use COMMIT of ROLLBACK in a trigger, it affects
logical transaction processing.

Is This Answer Correct ?    4 Yes 7 No

Post New Answer

More SQL PLSQL Interview Questions

how to select first 5 records from a table? : Sql dba

0 Answers  


Can a trigger call a stored procedure?

0 Answers  


What does seeding a database mean?

0 Answers  


What is procedure and function in sql?

0 Answers  


What is the difference between alter trigger and drop trigger statements?

0 Answers  






i have one table with accounts and amounts as colums.accounts with columns c and d. and amounts with values 1000,2000,3000 for c and 4000,5000,8000 for d.i need to find the sum of these accounts c and d individually and find the differences between their sum using one select statement.

11 Answers   Ebix, Hewitt,


What does inner join mean?

0 Answers  


What is right join in sql?

0 Answers  


What is rowid in sql?

0 Answers  


What is raid? How does it help storage of databases?

0 Answers  


List the differences between plsql - function & procedures

2 Answers   TCS, Verizon,


Advantages and disadvantages of stored procedure?

0 Answers  


Categories