Commit an insert statement in PL SQL : Transaction « PL SQL « Oracle PL / SQL






Commit an insert statement in PL SQL

 
SQL>
SQL> create table t ( x int );

Table created.

SQL>
SQL>
SQL> begin
  2          for i in 1 .. 100000
  3          loop
  4                  insert into t values ( i );
  5                  commit ;
  6          end loop;
  7  end;
  8  /

PL/SQL procedure successfully completed.

SQL>
SQL> drop table t;

Table dropped.

SQL>
SQL>
SQL> --

 








Related examples in the same category

1.set transaction use rollback segment
2.The pragma is legal in top-level anonymous blocks:
3.The pragma is not legal in nested blocks:
4.The pragma is valid in both standalone and local subprograms.
5.The pragma is valid in a packaged procedure.
6.interaction between savepoints and autonomous transactions.
7.Calling an autonomous function from SQL.
8.Autonomous transactions.