Results 1 to 3 of 3
  1. #1
    Join Date
    Jun 2004
    Posts
    24

    Unanswered: 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~

  2. #2
    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

  3. #3
    Join Date
    Jun 2003
    Location
    Toronto, Canada
    Posts
    5,516
    Provided Answers: 1
    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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •