views:

1862

answers:

2

Hi, there,

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 SQL*Plus 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 SQL*Plus 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

+4  A: 

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

Also, help is your friend.

shoover
Awesome! Exactly the information that I needed :) It worked like a charm.For anyone else who might benefit from his answer, God's way of getting the current working directory on command line, pwd, doesn't work in windows.for that, you do echo %CD%So, within sql*plus, you would writehost echo %cd%Thanks again, shoover :)
Hugo Estrada
A: 

Even I had the same issue. I tried to find the solution, but I settled down for a run.sql file solution. You can try some thing like this.

C:\Guru>Dir
11/27/2009  10:29 AM    <DIR>          .
11/27/2009  10:29 AM    <DIR>          ..
09/02/2009  07:15 PM    <DIR>          fol
09/02/2009  08.15 PM                   run.sql

In run.sql specify

@"c:\Guru\fol\a.sql"
show error
@"c:\Guru\fol\b.sql"
show error

And so on. You can give the folder structure as you wish. Even you can put them into windows BATCH file and execute them in one click.

Guru