Home » SQL & PL/SQL » Client Tools » Relative path to spool file
Relative path to spool file [message #281203] Fri, 16 November 2007 01:50 Go to next message
bibber
Messages: 38
Registered: August 2006
Member
Hi,

in sqlplus I start up a script, which also generates a spool file. But I want to use a relative path to the spool file, rather than absolute. The code I have right now isn't functioning.

@ c:\temp\sql\script.sql

---------------------------------->

spool ..\log\spool.log
SELECT 'test' from dual;
spool off

Re: Relative path to spool file [message #281207 is a reply to message #281203] Fri, 16 November 2007 01:56 Go to previous messageGo to next message
Michel Cadot
Messages: 64122
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
"isn't functioning" what does that mean?

"I want to use a relative path" relative to what?

What is your OS?
What is your Oracle version?

Regards
Michel


Re: Relative path to spool file [message #281208 is a reply to message #281203] Fri, 16 November 2007 01:58 Go to previous messageGo to next message
MarcS
Messages: 312
Registered: March 2007
Location: Antwerp
Senior Member
Could be lots of reasons why it isn't functioning.

So: do you get or see an error while executing the script? If so: why don't you let us know what the error is.

I've made lots of script where I use relative paths for spool-files, so I'm pretty sure it works Smile
Re: Relative path to spool file [message #281236 is a reply to message #281207] Fri, 16 November 2007 03:44 Go to previous messageGo to next message
bibber
Messages: 38
Registered: August 2006
Member
not functioning -> getting an error message "cannot create spool-file".

I want the spool-file to be created relative to the sql-script, so:
- location sql script: c:\temp\script\script.sql
- location spool script: c:\temp\log\spool.log

In my sql script I'd like to use ..\log\spool.log and not c:\temp\log\spool.log.

(oracle 9.2.0.5 and windows xp)
Re: Relative path to spool file [message #281238 is a reply to message #281236] Fri, 16 November 2007 03:46 Go to previous messageGo to next message
Michel Cadot
Messages: 64122
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
relative path is not relative to the script location but to the working directory of your SQL*Plus session.

Regards
Michel
Re: Relative path to spool file [message #281239 is a reply to message #281236] Fri, 16 November 2007 03:46 Go to previous message
MarcS
Messages: 312
Registered: March 2007
Location: Antwerp
Senior Member
bibber wrote on Fri, 16 November 2007 10:44

not functioning -> getting an error message "cannot create spool-file".

I want the spool-file to be created relative to the sql-script, so:
- location sql script: c:\temp\script\script.sql
- location spool script: c:\temp\log\spool.log

In my sql script I'd like to use ..\log\spool.log and not c:\temp\log\spool.log.

(oracle 9.2.0.5 and windows xp)


1 - Does the folder log exist in c:\temp and is it writeable ?

2 - What's the startup directory of sql*plus? The relative path must be seen from your startup directory
Previous Topic: Toad displays RRRR
Next Topic: How to pass values for out parameters from SQLPLUS
Goto Forum:
  


Current Time: Wed Dec 07 04:50:49 CST 2016

Total time taken to generate the page: 0.08246 seconds