Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

starting to use sql plus - where have all the tables gone? 1

Status
Not open for further replies.

mashadt

Instructor
Apr 23, 2005
33
ZA
I have just managed to install Oracle 10g and am now falling about trying to figure out how to use it.

I can open SQL*Plus, log in and create tables, insert data, recall and change the data and so on.

I can save the latest command that is in the buffer into a .sql file.

If I close SQL*Plus, and open it again, the table I have created still exists, but the attribute values seem to have dissapeared. If I try to call them up I get a "no rows selected" message.

Where is this table data saved?

How can I prevent the attribute values from dissapearing?

Have I got hold of the cat by the tail and am going about this in completely the wrong way?
 
Mashadt,

A "picture" is worth 1000 words.[smile] Can you please post a copy-and-paste of the code you have run and the the results that show the undesired circumstances?

Thanks,

[santa]Mufasa
(aka Dave of Sandy, Utah, USA)
[ Providing low-cost remote Database Admin services]
Click here to join Utah Oracle Users Group on Tek-Tips if you use Oracle in Utah USA.
 
It sounds like you are not committing your changes?

Could that be it? You might have had a tool that auto-committed for you in the past.

Cheers
 
Mashadt said:
If I close SQL*Plus, and open it again, the table I have created still exists, but the attribute values seem to have dissapeared. If I try to call them up I get a "no rows selected" message.

PC, I would agree with you if Mashadt's method of "closing" SQL*Plus was to just hit the "Close" (X) in the upper right of his SQL*Plus window...that would have been an abnormal termination to SQL*Plus, causing a ROLLBACK. If he "closed" SQL*Plus via an EXIT command even without a COMMIT, then SQL*Plus executes a COMMIT implicitly.

So, Mashadt, everything depends on how you say that you "closed" your SQL*Plus session. Please let us know, since that will give us the intelligence we need to assert what happened to your data.


[santa]Mufasa
(aka Dave of Sandy, Utah, USA)
[ Providing low-cost remote Database Admin services]
Click here to join Utah Oracle Users Group on Tek-Tips if you use Oracle in Utah USA.
 
This is what I suspected.

I have just, as you say, hit the close X in the upper right hand corner. What method should I use?

What I have done so far is to log on using system as my username. Then I can type in

create table dog
(name char(20), breed char(20));


Then I can put vaues in there by saying

insert into dog
values
('Anastasia', 'White Shepherd');

And then I carry on like this. Before I close sqlplus (incorrectly, as it turns out) I can recall these values,

select *
from dog;

And it shows me all the values I have inserted.

Once I close and open again, and I give the same command, I get a "no rows selected" message. The table still exists as I can continue loading values, and if I try to create another table by the same name, it wont let me.

Now I suspected it had to do with my method of "exiting". But up to now, why did I not just lose the table completely when I exited incorrectly? Why lose just the attribute values? Where is the table data stored?

Thanks ! :)
 
You ought to type commit; to make any changes permanent or rollback; to undo any changes since the last commit;

Then, if you close the session with the x you will not lose any work.

The other way to close sqlplus is to type exit and press enter. I did not realise that this method auto-commits for you but Mufasa wouldn't say it unless it was so ;)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top