Mega Code Archive

 
Categories / Oracle PLSQL / PL SQL
 

Insert 100000 rows into a table with for loop

SQL> create table t ( x int, y char(50) ); Table created. SQL> SQL> begin   2      for i in 1 .. 100000   3      loop   4          insert into t values ( i, 'x' );   5      end loop;   6      commit;   7  end;   8  / PL/SQL procedure successfully completed. SQL> SQL> select count(*) from t;   COUNT(*) ----------     100000 SQL> SQL> drop table t; Table dropped. SQL>