If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > Begin Transaction

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 07-12-04, 21:36
carmenlei carmenlei is offline
Registered User
 
Join Date: Jun 2004
Posts: 24
Begin Transaction

In SQLServer there are statement "BEGIN TRANSACTION a" to begin transaction, does db2 have an any statement doing the same work? And statements "Commit" and "Rollback" is the same as those in SQLServer?
Thanks very much~
Reply With Quote
  #2 (permalink)  
Old 07-12-04, 22:20
bmujeeb bmujeeb is offline
Registered User
 
Join Date: Mar 2004
Posts: 448
I think what you are looking for is

Compound SQL (Embedded):
Combines one or more other SQL statements (sub-statements) into an
executable block.

BEGIN COMPOUND ATOMIC/NOT ATOMIC

sql-statement ;

END COMPOUND

or

label: begin atomic
declare
variable declaration
sql procedure statement;
end label

check the

SQL reference from the IBM site

regards,

mujeeb
Reply With Quote
  #3 (permalink)  
Old 07-13-04, 09:14
n_i n_i is offline
:-)
 
Join Date: Jun 2003
Location: Toronto, Canada
Posts: 4,449
In DB2 a transaction is explicitly started with the execution of the first statement. You can also establish a savepoint (see SAVEPOINT statement in the reference) that allow you to roll back changes up to the savepoint and not to the beginning of the transaction.

COMMIT and ROLLBACK should function in the same manner as in SQL Server; however, I would check the SQL reference to confirm this.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On