Skip to Main Content
  • Questions
  • how to set default path to execute script in windows application sql*plus

Breadcrumb

Question and Answer

Tom Kyte

Thanks for the question.

Asked: July 22, 2007 - 12:50 pm UTC

Last updated: July 23, 2007 - 2:52 pm UTC

Version: 9.2.0.7

Viewed 1000+ times

You Asked

Hi Tom
I know this sounds very basic to ask...but here I am anyway.....
How do I set default path to execute my scripts from sql*plus application when invoked from windows?
I've network drive say, f:\main\teamname\scripts\admin\....here all my scripts are placed which I typically use....
When I invoke sqlplus from windows, its set to ORACLE_HOME\bin and I have to type in @....full path of the script to execute from sql prompt. Is there anyway I can set this default to f:\main\teamname\scripts\admin\ rather than oracle_home\bin?

Thanks a lot.


and Tom said...

In control panel -> system -> advanced tab, click the environment button.

add SQLPATH as an environment variable name, and f:\main\teamname\scripts\admin\ as the value.

you might have to log out/on to have this "stick"


when you can run a DOS window and see:

C:\Documents and Settings\tkyte>echo %SQLPATH%
Z:\tkyte\Documents and Settings\tkyte\My Documents\sqlstuff

you know it works.

Rating

  (1 rating)

Is this answer out of date? If it is, please let us know via a Comment

Comments

thats perfect

A reader, July 23, 2007 - 3:03 pm UTC

that was perfect....thanks a lot for the information....