@c:\new_directory\file_name or
start c:\new_directory\file_name
are two ways to run a file NOT in your startup directory.
Once you start in a directory, it stays as the default.
If the path name is long, I'd change the start location property of the desktop shortcut, then all you have to do is enter "@file_name"
You can verify the start location by typing host at the SQL> prompt. You should get an MS-DOS shell window with the cwd shown.
Another way is to write a SQL script that calls the other SQL files in their various directories. If you don't need to run every file, comment out the line, then run the master SQL script file. Write once, do many, Grasshopper.
1. My requiremnet is the SQL files are in differnet directories.
2. Different development groups add thier SQLs to diffrenet directory.
3. Without giving full path, I just go to differnet directory, run the master script in which all the script names are there. There is no fullpath for each of the file.
Originally posted by skdas 3. Without giving full path, I just go to differnet directory, run the master script in which all the script names are there. There is no fullpath for each of the file.
No, you go to where the master SQL file is, and EVERY file has an absolute path. You update the master file with the SQL files to be run.
If you generally run these sql scripts form one machine, you could alter your registry for SQLPATH:
HKEY_LOCAL_MACHINE\SOFTWARE\Oracle\(your oracle home)
open the SQLPATH and enter the folder locations, separated by a semicolon:
example - "c:\new_directry1;c:\new_directry2;c:\new_directry3;c:\new_directry4"
after updating your SQLPATH key, you will be able to type "@(name of sql script).sql" from sqlplus prompt and it will iterate through the directories in the registry path and run the first script it finds with that name.
Bookmarks