DECLARE V_CNT NUMBER := 100;BEGIN DBMS_OUTPUT.ENABLE; LOOP INSERT INTO EMP(EMPNO, ENAME, HIREDATE) VALUES (V_CNT, 'TEST' || TO_CHAR(V_CNT), SYSDATE); V_CNT := V_CNT + 1; EXIT WHEN V_CNT > 110; END LOOP; DBMS_OUTPUT.PUT_LINE('数据输入完成'); DBMS_OUTPUT.PUT_LINE('输入了' || TO_CHAR(V_CNT - 100) || '个');END;/SQL> SELECT * FROM EMP;EMPNO ENAME JOB MGR HIREDATE SAL COMM DEP----- ---------- --------- ----- ------------------- --------- --------- --- 100 TEST100 19-11-2014 16:47:12 101 TEST101 19-11-2014 16:47:12 102 TEST102 19-11-2014 16:47:12 103 TEST103 19-11-2014 16:47:12 104 TEST104 19-11-2014 16:47:12 105 TEST105 19-11-2014 16:47:12 106 TEST106 19-11-2014 16:47:12 107 TEST107 19-11-2014 16:47:12 108 TEST108 19-11-2014 16:47:12 109 TEST109 19-11-2014 16:47:12 110 TEST110 19-11-2014 16:47:12
?