RE: sql*plus autocommit and exit

  • From: "Allen, Brandon" <Brandon.Allen@xxxxxxxxxxx>
  • To: <dba.orcl@xxxxxxxxx>, "oracle-l" <oracle-l@xxxxxxxxxxxxx>
  • Date: Mon, 15 Aug 2005 12:16:03 -0700

Yes, that is the documented behavior - 'exit' will commit by default.  You must 
execute a 'rollback', or 'exit rollback' if you don't want to commit when you 
exit.  The autocommit option just applies to DML (insert/update/delete) 
commands - not the exit command.
 
Regards,
Brandon
 

-----Original Message-----
From: oracle-l-bounce@xxxxxxxxxxxxx [mailto:oracle-l-bounce@xxxxxxxxxxxxx]On 
Behalf Of Sami Seerangan
Sent: Monday, August 15, 2005 11:33 AM
To: oracle-l
Subject: sql*plus autocommit and exit


Hi:

I have a autocommit value set to OFF however when I exit from SQL*Plus it 
commits the transaction.
Is it a expected behavior?

SQL> show auto
autocommit OFF

SQL> delete from t1;
48601 rows deleted.

SQL> exit
Disconnected from Oracle Database 10g Enterprise Edition Release 10.1.0.2.0 - 
Production
With the Partitioning, OLAP and Data Mining options
C:\Documents and Settings\s397131\Desktop>sqlplus sami/sami
SQL*Plus: Release 10.1.0.2.0 - Production on Mon Aug 15 14:29:05 2005
Copyright (c) 1982, 2004, Oracle.  All rights reserved.

Connected to:
Oracle Database 10g Enterprise Edition Release 10.1.0.2.0 - Production
With the Partitioning, OLAP and Data Mining options

SQL> select count(*) from t1;

  COUNT(*)
----------
         0

SQL> show auto
autocommit OFF
SQL> 


Privileged/Confidential Information may be contained in this message or 
attachments hereto. Please advise immediately if you or your employer do not 
consent to Internet email for messages of this kind. Opinions, conclusions and 
other information in this message that do not relate to the official business 
of this company shall be understood as neither given nor endorsed by it.

Other related posts: