Hi All,
I've one simple question on Triggers, could be very silly , I searched my best, couldn't get the information I wanted, so please help, thank you.
I'm using a Row-Level trigger, my Update statement updates two rows, here, when I raise an error for just one row, the entire statement gets aborted, not just the Erroneous row alone. Does it happen as the entire statement is considered as a single Transaction? Could you please give some details on this?
create table tmp_emp_100
(emp_id number(4),
emp_name varchar2(100));
insert into tmp_emp_100
values(101, 'Emp101');
insert into tmp_emp_100
values(102, 'Emp102');
commit;
select * from tmp_emp_100;
create or replace trigger trg_emp_100
before update on tmp_emp_100
for each row
begin
if :new.emp_id=102 then
raise_application_error(-20001, 'Error on 102');
end if;
end;
update tmp_emp_100
set emp_name=emp_id || ' changed';