oracle11g - use of ROLLBACK command in Oracle -


i created table

sql>create table student ( studid         number(6), studname       varchar2(25), joindate       date );    table created.  sql>insert student values (123,'john',sysdate); 1 row created.  sql>delete student; 1 row deleted. 

how can row ? if use

sql>rollback; rollback complete. 

but after that

sql>select * student; no rows selected. 

why coming?

rollback tells oracle roll entire transaction. in case, both insert , delete part of same transaction rollback reverses both operations. returns database state in following create table statement.

some alternatives:

  1. if issue commit after insert delete statement in separate transaction , rollback reverse effect of delete statement.
  2. you create savepoint after running insert statement , rollback savepoint after delete rather rolling entire transaction.

Comments

Popular posts from this blog

SPSS keyboard combination alters encoding -

Add new record to the table by click on the button in Microsoft Access -

CSS3 Transition to highlight new elements created in JQuery -