Re: Spooling to a filename that contains spaces

Re: Spooling to a filename that contains spaces

 

  

You can't do that directly in SQL*Plus, but you can use an alternate way:
In Unix create a link to the file that has spaces within the name:

ln -s 'example 1.txt' example.txt

Thats it!, now in SQL*Plus you can spool to the no-spaces file:
Connected to:
Oracle Database 10g Enterprise Edition Release 10.1.0.2.0 - 64bit Production
With the Partitioning, OLAP and Data Mining options

SQL> set time on
13:54:15 SQL> spool example.txt
13:54:27 SQL> select sysdate from dual;

SYSDATE
-----------
04-sep-2007

13:54:43 SQL> spool off
13:54:51 SQL> exit
Disconnected from Oracle Database 10g Enterprise Edition Release
10.1.0.2.0 - 64bit Production
With the Partitioning, OLAP and Data Mining options

and the data goes directly to your within-spaces-in-the-name-file:
{test:db_1}% cat 'example 1.txt'
13:54:27 SQL> select sysdate from dual;

SYSDATE
-----------
04-sep-2007

13:54:43 SQL> spool off
{test:db_1}%

(Check out the ln manual, I used a link to a file, but you can create a
link to a directory (folder), I think that's what you need).

Israel.

>Williamson Nick wrote:
>
>
>>Hi all,
>>
>>Oracle 9i doesn't like this:
>>
>>spool 'c:\temp\spaces in the name\nick.txt'
>>
>>...and it doesn't seem that I can fix the problem by wrapping the
>>filename in an extra pair of single quotes. I know that on Windows, I
>>can change it to:
>>
>>spool 'c:\temp\spaces~1\nick.txt'
>>
>>...but I'd like a solution that would work on Unix as well. Is there a
>>way to do it?
>>
>>TIA
>>Nick
>>
>>
>>---------------------------------------------------------------------
>>TO REPLY TO EVERYBODY , PLEASE CLICK REPLY-ALL, NOT JUST REPLY
>>To post a dba job: http://jobs.lazydba.com
>>To Subscribe : http://www.LazyDBA.com
>>To unsubscribe: http://www.lazydba.com/unsubscribe.html
>>
>>
>>
>>
>>
>>
>
>
>
>---------------------------------------------------------------------
>TO REPLY TO EVERYBODY , PLEASE CLICK REPLY-ALL, NOT JUST REPLY
>To post a dba job: http://jobs.lazydba.com
>To Subscribe : http://www.LazyDBA.com
>To unsubscribe: http://www.lazydba.com/unsubscribe.html
>
>
>
>
>
>

Oracle LazyDBA home page