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

Answer Posted / 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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How do you use collections in procedure to return the resultset?

1789


What is %type in pl sql?

542


What is the difference between inner join and natural join?

513


What is error ora-12154: tns:could not resolve the connect identifier specified?

591


What are inner and outer joins examples of both?

499






What is the use of primary key?

537


When you have to use a default "rollback to" savepoint of plvlog?

723


What are the most important characteristics of pl/sql?

578


What is pl sql script?

564


What are the different sql commands?

520


What are the advantages of pl sql over sql?

548


What is the use of double ampersand (&&) in sql queries? Give an example

613


Is sql microsoft?

547


how many sql dml commands are supported by 'mysql'? : Sql dba

571


What schema means?

527