Home » SQL & PL/SQL » Client Tools » create subfolder using SPOOL
create subfolder using SPOOL [message #446149] Fri, 05 March 2010 13:54 Go to next message
jindalA
Messages: 3
Registered: March 2010
Junior Member
Hi,

I want to ask if we could create a subfolder using the SPOOL command. Please note that I tried the following but it gave "Cannot create Spool file" error.

Code: SPOOL C:\TEST\ABC\ABC.sql
where TEST is already present in the C drive whereas I want SPOOL command to create a sub-directory named 'ABC' and then create the spool file 'ABC.sql' isnside it.

Is this possible ?
My OS version is MS XP.

Re: create subfolder using SPOOL [message #446155 is a reply to message #446149] Fri, 05 March 2010 14:15 Go to previous messageGo to next message
BlackSwan
Messages: 25036
Registered: January 2009
Location: SoCal
Senior Member
>Is this possible ?
Not using SPOOL.

You need to issue HOST command from inside sqlplus & then issue normal OS command (mkdir) to create desired folder/directory.
Re: create subfolder using SPOOL [message #446159 is a reply to message #446149] Fri, 05 March 2010 14:29 Go to previous messageGo to next message
jindalA
Messages: 3
Registered: March 2010
Junior Member
I am also trying my hand if I could append the SYSDATE with the spool file name. Eg. ABC_20100305.sql ?

any idea on this ?
Re: create subfolder using SPOOL [message #446161 is a reply to message #446159] Fri, 05 March 2010 14:41 Go to previous messageGo to next message
Michel Cadot
Messages: 64103
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
set termout off
col dt new_value dt
select to_char(sysdate,'YYYYMMDDHH24MISS') dt from dual;
set termout on
spool file_&dt
...
spool off

Regards
Michel
Re: create subfolder using SPOOL [message #446166 is a reply to message #446149] Fri, 05 March 2010 15:07 Go to previous message
jindalA
Messages: 3
Registered: March 2010
Junior Member
Thanks for such a quick response, I appreciate it.
Previous Topic: Run Toad off a USB Flash
Next Topic: how to enable dbms profiler
Goto Forum:
  


Current Time: Sun Dec 04 22:46:05 CST 2016

Total time taken to generate the page: 0.10944 seconds