Insert 100000 rows into a table with for loop : Data Insert « PL SQL « Oracle 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>

   
    
    
    
  








Related examples in the same category

1.Use in parameter to pass value and insert value to a table
2.Data insert in a procedure
3.Insert data in procedure
4.Insert value passed in by parameter to a table
5.Insert value to a table after calculation
6.Insert value to product and productcategory with stored procedure
7.Insert value to table with for loop
8.Insert a specified number of suppliers and products per supplier
9.Loop through all to do a bulk insert
10.An anonymous block program to write the record to a row
11.This script demonstrates returning clause
12.Bulk insert with insert ... select
13.Hard code value and insert