continue after except. raised [message #255253] |
Tue, 31 July 2007 03:46  |
dusoo
Messages: 41 Registered: March 2007
|
Member |
|
|
Hi,
what i need to do, when an expection is raised, to do something in the exception block and then just continue with other operations using inserted value in that expection block?
example
declare
i_date date;
v_fid number;
begin
for i in (select * from temp_a where date > i_date)
loop
begin
select fid into v_fid from temp_b where colb_1 = i.cola_1;
-- When no data found, insert into temp_b new fid value in the excep. block
-- later here, i need to use the selected / inserted fid ...
insert into temp_c (fid, colc_5, colc_8) values (V_FID, i.cola_5, i.cola_8);
exception
when no_data_found
then insert into temp_b (fid, colb_1) values (tempb_sequence.next_val, i.cola_1);
end;
end loop;
end;
thanks a lot for any ideas.
|
|
|
|
Re: continue after except. raised [message #255260 is a reply to message #255255] |
Tue, 31 July 2007 04:01   |
dusoo
Messages: 41 Registered: March 2007
|
Member |
|
|
aah, yes. You're right, it's for ora 9 by the way.
And i was thinking, if is there other workarround then adding extra begin/end block inside. Like adding "continue" string in the exception block by keeping the value from the exception block ..
thanks anyway
|
|
|
|