trying to test a run time error
636309Aug 16 2011 — edited Aug 17 2011Hello,
Oracle 11g Enterprise Edition Release 11.2.0.1.0 - 64bit
Could you please help me figure out how to test the EXCEPTION handling section of my code? I want to try to force errors for each statement so that it hits the EXCEPTION handler section and logs the error. Here is a simplified version of the code (tables a and b have the same datatype): Thanks!
declare
cursor c1 is
select col1, col2 from tablea
minus
select col1, col2 from tableb;
type aaa is table of c1%rowtype;
bbb aaa;
begin
open c1;
fetch c1 bulk collect into bbb;
forall i in bbb.first .. bbb.last
update tableb
set col2 = bbb(i).col2
where col1 = bbb(i).col1
close c1;
exception
when other then
log('there was an error');
end;