PROCEDURE P_TASK IS BEGIN FOR MY_CU IN (SELECT SPBH, SPMCH FROM FUCM) LOOP FOR MY IN (SELECT SPBH, SPMCH FROM FUCM) LOOP IF MY_CU.SPBH = 'AAA' THEN RETURN; --exit; --continue; ELSIF MY.SPBH = 'BBB' THEN INSERT INTO FUCM_JG (SPBH, SPMCH) VALUES ('123', '123'); ELSE INSERT INTO FUCM_JG (SPBH, SPMCH) VALUES ('222', '222'); END IF; INSERT INTO FUCM_JG (SPBH, SPMCH) VALUES ('333', '333'); END LOOP; END LOOP; INSERT INTO FUCM_JG (SPBH, SPMCH) VALUES ('444', '444'); END P_TASK;