I have the function insert_val that inserts some values into some tables. These tables have triggers that raises exception when something is wrong. How can I rollback the function whenever a trigger raises exception and go to the next curs1 is this possible? Thanks in advance
res :='start';
OPEN curs1 FOR SELECT temp3.fid FROM temp3;
LOOP
FETCH curs1 INTO fidVar;
EXIT WHEN NOT FOUND;
BEGIN
if raise_exception then
rollback;
end if;
perform insert_val(fidVar,startDate,endDate);
END;
END LOOP;