Results 1 to 5 of 5
  1. #1
    Join Date
    Oct 2007
    Posts
    23

    Unanswered: about creat a table

    Hi,my questions is :
    CREATE TABLE dwaine.mytab (col1 INT, col2 INT)
    INSERT INTO dwaine.mytab VALUES (1,2)
    INSERT INTO dwaine.mytab VALUES (4,3)
    ROLLBACK
    The table created or not ? i know insert will rollback but i am not very clear that the table created ?
    thanks

  2. #2
    Join Date
    Dec 2005
    Posts
    273
    the CREATE TABLE is rollbacked, too.

  3. #3
    Join Date
    Jan 2007
    Location
    Jena, Germany
    Posts
    2,721
    And the reason is that the CREATE TABLE statement is - like any other SQL statement - executed in a transaction. Thus, if you roll back the transaction, the create table must be undone as well.
    Knut Stolze
    IBM DB2 Analytics Accelerator
    IBM Germany Research & Development

  4. #4
    Join Date
    Oct 2007
    Posts
    23
    If the statements is :
    CREATE TABLE dwaine.mytab (col1 INT, col2 INT)
    INSERT INTO dwaine.mytab VALUES (1,2)
    INSERT INTO dwaine.mytab VALUES (4,3)
    ROLLBACK
    COMMIT
    The table created or not ?
    Thanks !

  5. #5
    Join Date
    Dec 2005
    Posts
    273
    The table does no longer exist after the ROLLBACK.
    the following COMMIT has no effects in your scenario.

Posting Permissions

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