set transaction use rollback segment : Transaction « PL SQL « Oracle PL / SQL

Home
Oracle PL / SQL
1.Aggregate Functions
2.Analytical Functions
3.Char Functions
4.Constraints
5.Conversion Functions
6.Cursor
7.Data Type
8.Date Timezone
9.Hierarchical Query
10.Index
11.Insert Delete Update
12.Large Objects
13.Numeric Math Functions
14.Object Oriented Database
15.PL SQL
16.Regular Expressions
17.Report Column Page
18.Result Set
19.Select Query
20.Sequence
21.SQL Plus
22.Stored Procedure Function
23.Subquery
24.System Packages
25.System Tables Views
26.Table
27.Table Joins
28.Trigger
29.User Previliege
30.View
31.XML
Oracle PL / SQL » PL SQL » Transaction 
set transaction use rollback segment
 
  2
SQL> create table t
  2  as
  3  select from all_objects;

Table created.

SQL>
SQL>
SQL> set echo on
SQL> drop table done;

Table dropped.

SQL> create table doneobject_id int );

Table created.

SQL> insert into done values );

row created.

SQL>
SQL> declare
  2          l_cnt number;
  3          l_max number;
  4  begin
  5          select object_id into l_cnt from done;
  6          select max(object_idinto l_max from t;
  7
  8          while l_cnt < l_max )
  9          loop
 10                  update t
 11                     set object_name = lower(object_name)
 12                   where object_id > l_cnt
 13                     and object_id <= l_cnt+100;
 14
 15                  update done set object_id = object_id+100;
 16
 17                  commit;
 18                  set transaction use rollback segment rbs_small;
 19                  l_cnt := l_cnt + 100;
 20          end loop;
 21  end;
 22  /

PL/SQL procedure successfully completed.

SQL>
SQL> drop table t;

Table dropped.

SQL>
SQL> --

 
Related examples in the same category
1.Commit an insert statement in PL SQL
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.
java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.