Can i use Commit inside the Trigger? Suppose i use commit
what will be happy (it's complied /executed/work)

Answers were Sorted based on User's Feedback



Can i use Commit inside the Trigger? Suppose i use commit what will be happy (it's complied /e..

Answer / saraswathi muthuraman

Trigger will be compiled. while execution r error will occur.
To avoid this you can use PRAGMA autonomus_transaction

example :

create or replace trigger emp_test_trig
after update on emp_test
for each row
declare
PRAGMA autonomus_transaction;
begin

insert into dep_test values(100,:new.emp_id);
commit;
end;
/

Is This Answer Correct ?    18 Yes 0 No

Can i use Commit inside the Trigger? Suppose i use commit what will be happy (it's complied /e..

Answer / saravanakumar

you can commit trigger if the declaration part contains
autonomus transaction

Is This Answer Correct ?    10 Yes 0 No

Can i use Commit inside the Trigger? Suppose i use commit what will be happy (it's complied /e..

Answer / kannan

By using PRAGMA autonomus_transaction we can use commit
inside the trigger.

Is This Answer Correct ?    6 Yes 0 No

Can i use Commit inside the Trigger? Suppose i use commit what will be happy (it's complied /e..

Answer / swapna

commit,rollback and savepoint cannot be used in a trigger
directly, but it can be called in a stored procedure
present in the trigger. however it is usually avoided as it
might have sideeffects in transactions.

Is This Answer Correct ?    2 Yes 2 No

Can i use Commit inside the Trigger? Suppose i use commit what will be happy (it's complied /e..

Answer / suresh babu

You cannot use the commit inside the trigger,because the
Transaction Control Languages(TCL) are not allowed in trigger.

Is This Answer Correct ?    0 Yes 4 No

Can i use Commit inside the Trigger? Suppose i use commit what will be happy (it's complied /e..

Answer / coolpankaj

You can not use Commit Inside Trigger. It will not get complied.

Is This Answer Correct ?    1 Yes 6 No

Post New Answer

More SQL PLSQL Interview Questions

How does a covering index work?

0 Answers  


What is a schema? How is it useful in sql servers?

0 Answers  


How do you add a column to a table?

0 Answers  


Why use triggers in sql?

0 Answers  


explain what is mysql? : Sql dba

0 Answers  






what is foreign key? : Sql dba

0 Answers  


How do you copy a table in sql?

0 Answers  


how is myisam table stored? : Sql dba

0 Answers  


i have a table eno dno sal 1 10 200 2 10 150 3 10 100 4 20 75 5 20 100 i want to get sal which is less than the avg sal of thri dept. eno dno sal 2 10 150 3 10 100 4 20 75

11 Answers   IBM,


how can create data base link for tow servers (scott schema) give examples plz

2 Answers  


How can the performance of a trigger be improved?

0 Answers  


Can a table contain multiple foreign key’s?

0 Answers  


Categories