Friday, September 18, 2015

How to rollback Query on Oracle SQL Developer

You don’t need to use AUTOCOMMITED OFF; START TRANSACTION; in SQL Developer. All you need is after running the script just run ROLLBACK / COMMIT command, this will support insert/delete/update. Because by default in SQL Developer will not do auto commit.

If you give 
rollback;
Then the whole transactions is roll backed.

If you give 
commit;
Then the whole transaction is committed and all savepoints are removed.

If you give,
rollback to a; 
Then rollback up to the specified savepoints.
  
Example
insert into emp (empno,ename,sal) values (109,’Sami’,3000);
savepoint a;
insert into dept values (10,’Sales’,’Hyd’);
savepoint b;
insert into salgrade values (‘III’,9000,12000);

Cheers!

Uma

3 comments:

  1. HI

    I am having problem with Oracle SQL Developer
    ,
    When am running my query I got this error

    ORA-01722: invalid number
    01722. 00000 - "invalid number"
    *Cause: The specified number was invalid.
    *Action: Specify a valid number.

    ReplyDelete
  2. I feel really happy to have seen your webpage and look forward to so many more entertaining times reading here.Same as your blog i found another one Oracle Fusion HCM .Actually I was looking for the same information on internet for Oracle Fusion HCM and came across your blog. I am impressed by the information that you have on this blog. Thanks once more for all the details.

    ReplyDelete