I want to insert a bunch of record in DB2 by a procedure and when an exception raises I want rollback all other insert before this insert and iterate loop for the next cursor record
CREATE OR REPLACE PROCEDURE IMPORT_DATA_FROM_SIBA_ICMS2 (in IN_BRANCH_NO integer)
LANGUAGE SQL
MAIN_BLOCK:
BEGIN
DECLARE V_ID INTEGER DEFAULT NULL;
begin
insert into t1 --rollback this one when in the next on an exception occur
insert into t2
--an exception occur
end;