Skip to Main Content

SQL Developer

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

SQL Developer 2.1 Relative Path for Spooled Output

747298Jan 18 2010 — edited Jan 26 2010
Hi, has anyone had the chance to look into this question for me ...

when executing a script file from a network drive I would like the spooled output to appear in the same folder the script resides in. It does not at present, and appears in C:\Program Files\SQLDeveloper1.5.4\sqldeveloper\bin (goodness knows why here rather than a 2.1 directory, but that is not my real problem).

I am not able to hard code the path in the install script or use the script output pane to save the output.

The reason for this is we use individual folders for each change request in our release process. We have one or more master scripts which then execute scripts in subfolders. A dummied up sample is ....

DEFINE IR=1234

REM retrieve database name
COLUMN DB new_value DBNAME noprint
SELECT sys_context( 'USERENV', 'DB_NAME' ) DB FROM dual;

REM set up spool file
SPOOL .\IR_&IR._step1_release_cmds_&DBNAME..log

@.\dir1\script1.sql

@.\dir2\script2.sql

spool off

Once the change has been applied by the DBA in a test environment, the directory is moved to the the production release location and the the install script is executed from there. So hard coded paths are out, as is using the save button on the output pane as this is another chore to give the DBAs (you know they don't like that).

I had poked around to see if there are environmental variables I can embed in the spool statement, but there is little documentation I can find on this.

I need to know how to do this for us to be able to use SQL Devleoper for development / releases rather than TOAD as at present, so any help would be much appreciated.

Phil

Edited by: user12084425 on 25/01/2010 12:43
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Feb 23 2010
Added on Jan 18 2010
2 comments
2,130 views