实例:
/* 测试goto 的用法, */ procedure test_loop_go(pi_aab001 in number, po_fhz out varchar2, po_msg out varchar2) is cursor cur_ac02 is select * from ac02 where aab001 = pi_aab001; begin -- aab001 = 511500009511 , aac001 = 1000687490 ,如果是1000687490 这个人,那么就不更新 for v_cur in cur_ac02 loop if v_cur.aac001 = 1000687490 then goto the_next; elsif v_cur.aac008 = 1 then update ac02 a set a.aac008 = 6 where aac001 = v_cur.aac001 and aae140 = v_cur.aae140; end if; <<the_next>> null; end loop; end test_loop_go;