[Webinar] Streamline your web hosting managementRegister Today

x
?
Solved

Starting SQL+ Scripts from Anywhere

Posted on 1999-11-21
4
Medium Priority
?
321 Views
Last Modified: 2012-05-04
Hello.

Is there a way to run a SQL script file
from anywhere, no matter what directory/folder it's located? In the old DOS days (and to some extent, Windows) you had a path statement in the AUTOEXEC.BAT file, or you could set the PATH environment with SET PATH=....

Does Oracle provide a similar method to do this? i.e. Perhaps  directories/folders off of the BIN directory/folder would enable one to run
the program using only:

SQL>start filename.sql

instead of typing the full path to the file each and every time. Or, perhaps one could have a script named go.sql which would accept a filename as its argument.

Any suggestions?

Jim
0
Comment
Question by:jnowlin
4 Comments
 

Accepted Solution

by:
ivenkys_1 earned 100 total points
ID: 2224100
Jim wat u cld possibly do is
write ur script into a file called as login.sql.
it loads everytime u startup sqlplus.
also chek the registry entry for oracle it shld b able to provide the oracle path settings in it.

venky.
0
 
LVL 6

Expert Comment

by:mshaikh
ID: 2224161
If you start SQLPLUS from the directory where the scripts are located then you don't have to specify the path. It will first look in the directory from which SQLPLUS was started. If your scripts are in C:\MYSCRIPTS then do the following:

C:
cd C:\MYSCRIPTS
sqlplus



Now, if filename.sql is in C:\MYSCRIPTS you could type:
SQL>start filename.sql
0
 
LVL 3

Expert Comment

by:mgokman
ID: 2226195
Go to your registry and set the value:
ORACLE_PATH to the path you want Oracle to search when looking for your script.
I have another suggestion.
By the way, all answers to all your questions can be easily found in the docs on your CD.
0
 

Author Comment

by:jnowlin
ID: 2274228
Mr. Gokman, you are a DBA. I regret that the local library didn't have your book on hand. It must surely be very helpful and informative.

Our instructor told us that
DBAs are like God and that we should get to know very well these people, stay on there good side. Any suggestions along these lines sir?

Jim Nowlin
Princeton, MA   U.S.A.
0

Featured Post

The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Have you ever had to make fundamental changes to a table in Oracle, but haven't been able to get any downtime?  I'm talking things like: * Dropping columns * Shrinking allocated space * Removing chained blocks and restoring the PCTFREE * Re-or…
How to Unravel a Tricky Query Introduction If you browse through the Oracle zones or any of the other database-related zones you'll come across some complicated solutions and sometimes you'll just have to wonder how anyone came up with them.  …
This video shows how to copy a database user from one database to another user DBMS_METADATA.  It also shows how to copy a user's permissions and discusses password hash differences between Oracle 10g and 11g.
Via a live example, show how to take different types of Oracle backups using RMAN.
Suggested Courses

591 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question