Re: How do you save in SQL?

From: Toine van Beckhoven <A.A.M.v.Beckhoven_at_inter.nl.net>
Date: 1997/02/03
Message-ID: <32F65C71.209E_at_inter.nl.net>#1/1


E. Kammin wrote:
>
> Issue command 'commit' after entering a row.
> sears_at_koyote.com wrote:
>
> >Hi, I am a beginner studying SQL databases in Oracle, and
> >running into little annoying problems. First, here is
> >the senario. To acess Oracle, I telnet from home to
> >my school Unix account. The problem is that my telnet
> >locks up every time without warning, and I have to close

> >the application. Therefore, all data is lost if not
> >saved. I was working on my first table and had some
> >rows of data entered. I tried to save it with the same
> >filename as I used when i created the table, but it would
> >not let allow me to do that. So I saved with a different
> >filename like wood2.sql. Then the telnet locked up. I close
> >and got back in, and was horrified to see that
> >when I did a select statement, it would not show any of the
> >rows of data I had entered. So what did I do wrong? How
> >can you view your saved files on Oracle? How can you
> >save the rows? Please help.
> >-------------------==== Posted via Deja News ====-----------------------
> > http://www.dejanews.com/ Search, Read, Post to Usenet

Hi,

You have to make a distinction between two types of savings in Oracle SQL*Plus (I assume that was the tool you were working with?), namely

  1. saving a SQL*script (with i.e. Insert statements for your rows) and
  2. saving data in the database.

The first one is done via the SQL*Plus 'save' command as you probably found out. If you try to save an existsing script file (like the wood1.sql you entered SQL*Plus with) you can replace it entirely with the 'save replace' command, or add to the existing one via the 'save add' (I believe it was add or something like that) command. The commands save you SQL scripts to disk.

The second kind of saving, saving data is called 'committing': with the SQL statement 'commit;' you save entered data, or updated data, or delete data to the database.

So: you execute any sqlscript you like (like your wood1.sql) and when you want to save your rows: 'commit;' (or 'rollback' to undo the changes you made to the database)

Success,

Toine van Beckhoven Received on Mon Feb 03 1997 - 00:00:00 CET

Original text of this message