Data Warehousing Community Forum
February 08, 2012, 11:06:10 pm

Pages: [1]   Go Down
  Print  
Author Topic: Control transaction statements  (Read 728 times)
Arvind
DW Apprentice
**

Reputation: +10/-0
Offline Offline

Posts: 78


View Profile
« on: June 04, 2008, 09:24:59 pm »

Can you explain, what are all the control statements which end a current transaction and makes permanant data changes to the transaction.

And also please define the SET TRANSACTION option !

Appreciated your help !
Logged

regards,
Arvind
Sipra
Founder
*****

Reputation: +59/-0
Offline Offline

Posts: 323


Am the King...


View Profile WWW
« Reply #1 on: June 25, 2008, 02:01:57 pm »

The follwoing are the transaction control statements

COMMIT-
   To make the changes done in a transaction permanent issue the COMMIT statement.
ROLLBACK  -
   Rollbacks the state of database to the last commit point.
SAVEPOINT -    
   Specify a point in a transaction to which later you can roll back..

For example -
insert into tab1(col11,col12) values (val11,val12);
savepoint a;
insert into tab2(col21,col22) values (val21,val22);
savepoint b;


Now if we give a commad -
rollback to a;
then the rows inserted into to tab2 will be roll backed.
Now we can commit the row inserted into tab1 table or rollback the transaction.

Then SET TRANSACTION is an Advanced Transaction Control statement which is supported in SQLJ and to specify the access mode and isolation level of any given transaction.
Logged

Pages: [1]   Go Up
  Print  
 
Jump to: