Difference between rollbac and rollback

What is the difference between rollbac and rollback?


SQL> create table t as select 1 x from dual;

Table created.

SQL> update t set x=2;

1 row updated.

SQL> savepoint a;

Savepoint created.

SQL> update t set x=3;

1 row updated.

SQL> rollbac to savepoint a;
Rollback complete.
SQL> select * from t;
X
----------
1

WTF! rollbac does not seem to work correctly 😉

Actually, ROLL, ROLLB, ROLLBA and ROLLBAC are not valid SQL statements. However, SQLPLUS recognizes it a sqlplus statement but this behavior is not documented.


SQL> del *
SQL> roll
Rollback complete.
SQL> list
SP2-0223: No lines in SQL buffer.

The statement does not end with semi-column and is not stored in the SQLPLUS buffer.

So it is not a SQL command.

4 thoughts on “Difference between rollbac and rollback

  1. Sokrates

    very interesting !

    and, did you notice, when you trace this session, the rollback doesn’t even occur in the trace file !
    (Though, user rollbacks as well as transaction rollbacks is incremented by 1 in V$sesstat)

  2. Pingback: Log Buffer #112: A Carnival of the Vanities for DBAs

  3. Pingback: ROLL in HELP INDEX SQL 10g - dBforums

Comments are closed.