Christopher Kings-Lynne <chriskl@familyhealth.com.au> writes:
> > Yup.. And some of us intend on wrapping every single statement in a
> > subtransaction so we can rollback on an error without aborting the main
> > transaction.
>
> Point there being "main transaction". What i'm saying is that the vast
> majority of your "transactions" will be single statements. eg. single selects,
> single updates, etc.
And if autocommit mode is off, which is how I would strongly urge people to
work, these single statements will be a subtransaction within a main
transaction.
> > In fact, I would be surprised if tools like psql went very long without
> > doing the same thing so users can recover from spelling mistakes.
>
> If the user does an explicit BEGIN, then perhaps we might, but how often does
> the user do an explicit BEGIN?
Well currently very rare since it's so infuriating to have to start all over
when you make a spelling error. As long as autocommit mode is on the same
thing would happen.
But in Oracle autocommit mode is OFF in the command line tool. You have to
type commit to commit any changes. At first this is surprising and annoying,
but after a while you find it's terribly useful and a much safer way to work.
You can do an update, then double-check that you did the right thing before
committing it.
--
greg