MySQL rollback
Results 1 to 2 of 2

Thread: MySQL rollback

Hybrid View

  1. #1
    Join Date
    Aug 2012
    Posts
    2

    Question MySQL rollback

    Hi there,

    I have this issue. Ive been learning SQL for a while now and I am testing out the rollback feature and so i created a simple table and populated it with fake data and created a "savepoint" and then try to rollback to it. My compiler shows it creates the "savepoint" and then when i try to rollback to it, it says it doesnt exsit yet it clearly just created the savepoint with no issue. Im pretty sure i didnt write anything wrong so i am not sure whats going on. Here is the code. If you can take a look and tell me whats wrong that would be greatly appricated!
    Code:
    use learnsql;
    insert into customer_tbl values
    (
    '615', 'FRED WOLF', '109 MEMORY LANE', 'PLAINFEILD', 'IN', '46113', '3175555555', NULL
    );
    
    insert into customer_tbl values
    (
    '559', 'RITA THOMPSON', '125 PEACHTREE', 'INDIANAPOLIS', 'IN', 46248, 3171111111, NULL
    );
    
    insert into customer_tbl values
    (
    '715', 'BOB DIGGLER', '1102 HUNTINGTON ST', 'SHELBY', 'IN', 41234, 3172222222, NULL
    );
    savepoint SAVEPOINT1;
    
    update customer_tbl
    set CUST_NAME ='FRED WOLF'
    where CUST_ID = '559';
    
    update customer_tbl
    set CUST_ADDRESS = 'APT C 4556 WATERWAY'
    where CUST_ID = '615';
    
    update customer_tbl
    set CUST_CITY = 'CHICAGO'
    where CUST_ID = '715';
    
    rollback to SAVEPOINT1;
    
    select*from learnsql.customer_tbl;

  2. #2
    Join Date
    Nov 2002
    Location
    New Jersey, USA
    Posts
    3,862
    Syntax looks good, can you confirm if your is database InnoDB?

Posting Permissions

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