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
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 |
Answer / saravanakumar
you can commit trigger if the declaration part contains
autonomus transaction
| Is This Answer Correct ? | 10 Yes | 0 No |
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 |
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 |
Answer / coolpankaj
You can not use Commit Inside Trigger. It will not get complied.
| Is This Answer Correct ? | 1 Yes | 6 No |
What is user defined functions?
How does one use sql*loader to load images, sound clips and documents? : aql loader
If a View on a single base table is manipulated will the changes be reflected on the base table?
how many no of table can be join in a sql query.
Which kind of parameters cannot have a default value in pl sql?
how to convert numeric values to character strings? : Sql dba
How does a self join work?
write a query to display diference between two dates in sql server
7. Where would you look for errors from the database design?
Can we create a trigger on view?
What is a ddl command?
I have a small PL/SQL Block assume in this way begin select * from emp where empno=100; exception when others then <Some Messages> when no_data_found then <Some Messages> when too_many_rows then <Some Messages> end; The question which he asked was whether this block will get executed normally or it will throw error ? If errored out then what is the reason for the error ? Could anybody please help me ? Regards Nakul Venkataraman
Oracle (3259)
SQL Server (4518)
MS Access (429)
MySQL (1402)
Postgre (483)
Sybase (267)
DB Architecture (141)
DB Administration (291)
DB Development (113)
SQL PLSQL (3330)
MongoDB (502)
IBM Informix (50)
Neo4j (82)
InfluxDB (0)
Apache CouchDB (44)
Firebird (5)
Database Management (1411)
Databases AllOther (288)