Unix Technical Forum

Sql*plus Auto-Commit

This is a discussion on Sql*plus Auto-Commit within the Oracle Database forums, part of the Database Server Software category; --> I exited SQL*plus with commit/rollback and my transaction was coimmitted. How can I disable this auto-commit behavior ? thanks ...


Go Back   Unix Technical Forum > Database Server Software > Oracle Database

Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 02-25-2008, 08:09 AM
klabu
 
Posts: n/a
Default Sql*plus Auto-Commit

I exited SQL*plus with commit/rollback and my transaction was coimmitted.

How can I disable this auto-commit behavior ?

thanks

--
10gR2


Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 02-25-2008, 08:09 AM
joel garry
 
Posts: n/a
Default 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


Don't know if google lost my previous reply, but you can't. However,
you can exit rollback. See the manual.

jg
--
@home.com is bogus.
http://www.mcphee.com/categories/weird.html

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 02-25-2008, 08:09 AM
Mark D Powell
 
Posts: n/a
Default Re: Sql*plus Auto-Commit



On Oct 27, 2:18 pm, "klabu" <nosuchuser_at_gmail_dot_com> wrote:
> I exited SQL*plus with commit/rollback and my transaction was coimmitted.
>
> How can I disable this auto-commit behavior ?
>
> thanks
>
> --
> 10gR2


>From the 10gR2 SQL*Plus Users Guide >> EXIT with no clauses commits and

exits with a value of SUCCESS. <<

Try EXIT ROLLBACK. As long as autocommit is off that should work.

HTH -- Mark D Powell --

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 02-25-2008, 08:09 AM
fitzjarrell@cox.net
 
Posts: n/a
Default 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


Has reading the manual occurred to you?

http://tahiti.oracle.com



David Fitzjarrell

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 02-25-2008, 08:10 AM
jerry
 
Posts: n/a
Default Re: Sql*plus Auto-Commit

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

klabu wrote:
> I exited SQL*plus with commit/rollback and my transaction was coimmitted.
>
> How can I disable this auto-commit behavior ?
>
> thanks
>
> --
> 10gR2


Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #6 (permalink)  
Old 02-25-2008, 08:10 AM
Mladen Gogala
 
Posts: n/a
Default Re: Sql*plus Auto-Commit

On Fri, 27 Oct 2006 14:18:06 -0400, klabu wrote:

> How can I disable this auto-commit behavior ?


SET RTFM ON

--
http://www.mladen-gogala.com

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #7 (permalink)  
Old 02-25-2008, 08:10 AM
Mark D Powell
 
Posts: n/a
Default Re: Sql*plus Auto-Commit


Mladen Gogala wrote:
> On Fri, 27 Oct 2006 14:18:06 -0400, klabu wrote:
>
> > How can I disable this auto-commit behavior ?

>
> SET RTFM ON
>
> --
> http://www.mladen-gogala.com


LOL

not bad, for once.

-- Mark --

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #8 (permalink)  
Old 02-25-2008, 08:11 AM
William Robertson
 
Posts: n/a
Default 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/c...0.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/c...57/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.

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #9 (permalink)  
Old 02-25-2008, 08:11 AM
klabu
 
Posts: n/a
Default Re: Sql*plus Auto-Commit


"Mladen Gogala"
> SET RTFM ON
>



klabu@ppd1> SET RTFM ON
SP2-0158: unknown SET option "RTFM"

maybe you should RTFM


Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #10 (permalink)  
Old 02-25-2008, 08:11 AM
klabu
 
Posts: n/a
Default Re: Sql*plus Auto-Commit


"William Robertson"
> http://download-uk.oracle.com/docs/c...0.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/c...57/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.



Exactly
I RTFM that part

Hence I posted question asking you gurus & hoping there just might be a way
of avoiding "ooops I exited "by accident" and my sh*t got all COMMITTED !!!"


Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 09:48 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com