我有如下代码:
DECLARE
rec emp%ROWTYPE
BEGIN
<<start_again>>
FOR rec IN c1 LOOP
SELECT emp_index
INTO flag
FROM m_sme006
WHERE emp_id = rec.emp_id
AND eff_dt = rec.eff_dt
AND end_dt = rec.end_dt
AND last_maint_ts > rec.last_maint_ts;
END LOOP;
EXCEPTION
WHEN no_data_found THEN
GOTO start_again;
END;
每次发生 no_data_found 异常时,我都希望执行返回并继续下一次迭代。但它抛出error PLS-00375: illegal GOTO statement
我也可以将此行包含dbms_output.Put_line('Outside exception block'rec.sme006_index);
在异常块中以查看发生的位置吗?
提前致谢