Sharon Shelton
Sharon Shelton

Reputation: 35

Is it possible to use savepoint and rollback in Oracle express edition?

I'm using Oracle express edition. Whenever I use the savepoint statement, I get an invalid statement error. Is it not valid in Oracle express edition. I'm using the latest version. I also faced the same problem when I was using the desktops in my university. I don't know what's wrong with it. I'll be so happy with your help. Many thanks.

Edit:

My code:

savepoint s;

The error that I'm getting

ORA-00911: invalid character

Upvotes: 0

Views: 844

Answers (2)

loic
loic

Reputation: 151

ROLLBACK to SAVEPOINT is supported by the free Oracle Database Express Edition. Tested with the 18c release: https://www.oracle.com/database/technologies/appdev/xe.html

Limitations of this version are listed here: https://docs.oracle.com/en/database/oracle/oracle-database/18/xelic/licensing-information.html#GUID-0F2574A6-360F-4237-8098-17B02FFC3BB3

Your error "00911: invalid character" is related to the way you invoke the "SAVEPOINT S;" command...

For instance in Java, you would need to get rid of the ";" character to make it work:

 [...]
 Statement s = c.createStatement();
 ResultSet r = s.execute( "SAVEPOINT S" ); // "SAVEPOINT S;" will produce ORA-00911
 [...]

Upvotes: 1

Littlefoot
Littlefoot

Reputation: 142705

Just to answer the title question: yes.

SQL> select * From v$version;

BANNER
--------------------------------------------------------------------------------
Oracle Database 11g Express Edition Release 11.2.0.2.0 - 64bit Production
PL/SQL Release 11.2.0.2.0 - Production
CORE    11.2.0.2.0      Production
TNS for 64-bit Windows: Version 11.2.0.2.0 - Production
NLSRTL Version 11.2.0.2.0 - Production

SQL> savepoint a;

Savepoint created.

SQL> delete from emp;

14 rows deleted.

SQL> rollback to a;

Rollback complete.

SQL>

Upvotes: 0

Related Questions