Link to home
Start Free TrialLog in
Avatar of Kin Fat SZE
Kin Fat SZEFlag for Hong Kong

asked on

setting command path of sqlplus

Experts,
I created a .sql (showtables.sql) at C:\oraclexe\command. Well, if I start sqlplus from that directory and run @showtables It fine...
But, one problem is comming..... How could I set command path of sqlplus, so that I could run @showtables by sqlplus from anydirectory?
Please have a look of code snippet...

note : if anyone could give me fully detail what should I do.... I must given max points on the question.
C:\oraclexe\command>sqlplus test/test007
SQL> @showtables;
 
OWNER      TABLE_NAME
---------- --------------------
TEST       TEST2_SQL
TEST       TEST22
TEST       TESTDATE
TEST       T1
TEST       TEST_NUMBERS
TEST       CUSTOMERS
TEST       TEST
TEST       GROUPS
TEST       PRODUCTS
TEST       T
 
 
 
C:\>sqlplus test/test007
SQL> @showtables;
SP2-0310: !Õ‹_”H "showtables.sql"

Open in new window

Avatar of crawfordits
crawfordits

@C:\oraclexe\command\showtables.sql
Avatar of Kin Fat SZE

ASKER

no, I would like to just run @showtables by sqlplus from any directory (path)
file at C:\oraclexe\command>
but run it from c:\
C:\>sqlplus test/test007
SQL> @showtables;
possible?
ASKER CERTIFIED SOLUTION
Avatar of johnsone
johnsone
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Yes, that's what I am looking for, thanks
Well if you run the sqlplus command in a command prompt then you can run it from anywhere.  I tell you how to do this below.

Unfortunately you can't set a path enviornment in sqlplus.  But for some other sqlplus environment settings look here: http://www.orafaq.com/wiki/SQL*Plus_FAQ

Right click on my computer, go to advanced tab.
click environment variables button and new.

type in showtables for variable name
type in full path to showtables in variable value, and use quotes if there is any odd characters.
IE: "C:\oraclexe\command\showtables.sql"
click ok

open a command prompt and type sqlplus "test/test007" @showtables [ENTER]
and it should run just fine.