Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SQL Plus: how to change directory and show current working directory

I just installed Oracle, and I am working with SQL*Plus because the GUI tool, SQL Developer, won't work.

I need to run some scripts, and I found that after starting SQLPlus I couldn't navigate from a session to another directory. The instructions that I did find after I searched on the internet all talk about a gui interface to SQLPlus which is no longer available on version 11. All what I get is a console window.

Right now I hacked my way into making it work for me by creating a shortcut and then changing the starting directory to the directory where the scripts are housed.

I can keep doing this, but I would like to know if there is a command that will let me know a) the current working directory and b) how to change directories

Thanks in advance,

Hugo

like image 593
Hugo Estrada Avatar asked Dec 03 '09 15:12

Hugo Estrada


People also ask

How do I change the working directory in Sqlplus?

In UNIX/Linux and Windows it is fastest to simply exist SQL*Plus, cd to the appropriate directory and re-enter SQL*Plus.

Which command changes current working directory?

The pwd command can be used to determine the present working directory. and the cd command can be used to change the current working directory.

How do I change directories in SQL Developer?

It changes the place where settings are stored. Connections are stored in this directory by default, but if you want to make sql developer store scripts in this directory you still have to go to Tools>Preferences>Database>Worksheet and change "Select default path to look for scripts".

What command would you type to change the current working directory to your desktop?

cd - Changing Directories You can use the cd command, which stands for Change Directory. From within ~ , our home directory, at our prompt $ , we type cd Desktop . Our terminal will change the directory and enter our Desktop folder and our prompt will now indicate that our working directory is ~/Desktop .


2 Answers

Try: host pwd and host cd somedir. You can also enter just host to get a command prompt.

Also, help is your friend.

like image 98
shoover Avatar answered Nov 12 '22 12:11

shoover


The host command runs a subshell under unix. Thus, cd will change the directory in the subshell, but not for SQL*Plus itself.

like image 24
Karsten Spang Avatar answered Nov 12 '22 13:11

Karsten Spang