We cannot use TCL like commit or rollback in Triggers.A Trigger may not issue any transactional control statements-COMMIT, ROLLBACK or SAVEPOINT. The trigger is fired as part of the execution of the triggering statement and is in the same transaction as the triggering statement. When the triggering statement is committed or rollback, the work in the trigger is committed or rollback as well.
But by using pragma autonomous_transaction we can give TCL commands in triggers.
create or replace
trigger UPDATEEMP1 before insert on EMP1 for each row
IF (TO_CHAR(SYSDATE,'DAY')) IN ('SUNDAY','SATURDAY ')
RAISE_APPLICATION_ERROR(-20222,'site will not work on weekends');
insert into EMP2 values(:new.EMPNO,:new.ENAME,:new.job,:new.MGR,:new.HIREDATE,:new.SAL,:new.COMM,:new.DEPTNO);
If we create a trigger like above and
insert into emp1 select * from emp where empno=7369;
then it will insert record into emp2 and committed for emp2. But emp1 is not committed .
Now if you rollback emp1 new record will be removed and emp2 new record will not be removed.