Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: SQL+ forgets things... ?!

Re: SQL+ forgets things... ?!

From: Rauf Sarwar <rs_arwar_at_hotmail.com>
Date: 14 Jul 2002 22:21:49 -0700
Message-ID: <92eeeff0.0207142121.6dc2de5d@posting.google.com>


> That was a joke/sarcasm. There's no need to get defensive here.
> I asked the question in order to *Learn*. Why does the editor
> forget things?

I did not create this tool so there is no need for me to be defensive about it...Right? I just use it and have been for a long time and never complained about it. Agreed...it could be a lot of things to lots of people but it is what it is. If you want to search back thru the screen buffer then use console sqlplus which will give you all the functionality of DOS prompt and sqlplus...Up arrow to previous line etc.

>
> Besides - what's so fancy about a program that saves your work on
> exit? Does somebody call that a feature Anno Domini 2002?

Sqlplus does not save/commit your work on exit. There are two possibilities.

  1. SET AUTOCOMMIT ON -- This will automatically commit all DML's. In this case, it does not matter you exit or not, your last DML is automatically committed.

SQL> set autocommit on
SQL> create table test_foo (test_ number); Table created.
SQL> insert into test_foo values (1);
1 row created.
Commit complete. -- This is automatically issued. You have no control over it.
SQL> select * from test_foo;

     TEST_


         1

No chance of rollback so *Not* a preferred solution.

2) SET AUTOCOMMIT OFF SQL> set autocommit off
SQL> insert into test_foo values (2);
1 row created. -- No autocommits here.
SQL> select * from test_foo;

     TEST_


         1
         2

At this time if you exit, row 2 is not saved/committed. If you issue a rollback at this time, it is same as exiting.

SQL> rollback;
Rollback complete.
SQL> select * from test_foo;

     TEST_


         1

Instead of rollback, if you issue a commit; then row is saved. This gives you flexibility so it is a preferred solution. BTW...autocommit is set to off by default.

Hope this makes it clear.
//Rauf Sarwar Received on Mon Jul 15 2002 - 00:21:49 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US