Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Sql*plus Auto-Commit
> klabu wrote:
> > I exited SQL*plus with commit/rollback and my transaction was coimmitted.
> >
> > How can I disable this auto-commit behavior ?
> >
> > thanks
> >
> > --
> > 10gR2
jerry wrote:
> Create a login.sql file if you do not already have one and add the line
>
> set autocommit off
>
> I suggest you read the SQL*PLUS Users Guide for further details re. the
> location of the file.
>
> Jerry
I'm not sure how that helps here.
http://download-uk.oracle.com/docs/cd/B19306_01/server.102/b14357/ch12040.htm#i2698639
tells us:
"SET AUTOCOMMIT does not alter the commit behavior when SQL*Plus exits.
Any uncommitted data is committed by default."
Possibly the OP read that and wondered how to change this "default" behaviour, which you cannot, since there is an implicit COMMIT when exiting from SQL*Plus (for example, try violating a deferred constraint then exiting. Just for fun, set a WHENEVER SQLERROR EXIT ROLLBACK condition first.)
I suppose the page for EXIT
http://download-uk.oracle.com/docs/cd/B19306_01/server.102/b14357/ch12023.htm
does say
"Commit on exit ... is performed regardless of the status of SET
AUTOCOMMIT."
However you might still wonder whether some alternative exists that
does not involve the autocommit setting (there isn't one). Sometimes
this type of thing is not obvious from the documentation, though.
Received on Sun Oct 29 2006 - 17:31:54 CST