Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

how to spool to C:\Documents and Settings\xzeng\My Documents?

3,481 views
Skip to first unread message

sasworks

unread,
Aug 18, 2008, 6:55:48 PM8/18/08
to
I have no problem spooling files to directories like C:\myfolder. But
in Windows, I use "My Documents" folder alot and that directory name
has spaces in it. I tried the following:

Spool 'C:\Documents and Settings\xzeng\My Documents\myfile.txt'

And the SQL+ says "Spool unsucessful".

How do I spool the output to a directory whose name has spaces in
it???

Thank you very much!

Malcolm Dew-Jones

unread,
Aug 18, 2008, 8:40:48 PM8/18/08
to
sasworks (xuze...@gmail.com) wrote:
: I have no problem spooling files to directories like C:\myfolder. But

I know three things that work

1. In sqlplus (command line version) I start it from the command line from
within the desired directory. Then I use the spool command without
specifying the directory. The output goes into the current directory.

DOS> cd Q:\this path\has spaces\in it\work
DOS> sqlplus

SQL> spool X (creates X.LST in the above directory)

This also works for sqlplusw (the window version of sqlplus). I launch
sqlplusw from the command line so this easily works for me, but if you
want to open it with the mouse then you can probably set the current
directory within a lnk file to make that work, though I haven't tested
that.


2. In sqlplusw (window version) I use File::Spool to select the directory
and attempt to create a spool file in that directory.

The create fails, but the selected directory becomes the current directory
(if it isn't already) and then you can spool the file without specifying
the path, just like 1. above.

3. You can use the short path name which does not have spaces in the file
name.

DIR/X will show you short names, but you have to use it multiple times
to find each short name in the path.

If you start an old program like EDIT or DEBUG and NT will switch to using
the 8.3 names, and then the path shown in CD or DIR and etc will show the
complete path using 8.3 names only. There is probably a much better way
to do this, but I don't do this often so running an old program is what I
am able to remember when I need it.

Terry Dykstra

unread,
Aug 19, 2008, 10:14:58 AM8/19/08
to
"Malcolm Dew-Jones" <yf...@vtn1.victoria.tc.ca> wrote in message
news:48aa0880$1...@news.victoria.tc.ca...

Use double quotes instead of single quotes around the spoolfile name.

--
Terry Dykstra


Malcolm Dew-Jones

unread,
Aug 20, 2008, 7:09:36 PM8/20/08
to
Terry Dykstra (tddy...@forestoil.ca) wrote:
: "Malcolm Dew-Jones" <yf...@vtn1.victoria.tc.ca> wrote in message

: --
: Terry Dykstra

That doesn't work for me.

SQL*Plus: Release 10.1.0.5.0 - Production on Wed Aug 20 15:06:27 2008
Copyright (c) 1982, 2005, Oracle. All rights reserved.
SQL>


First, check I can spool somewhere using short name

SQL> spool C:\progra~1\try
SQL> spool
currently spooling to C:\progra~1\try.LST
SQL> spool off

Examine the result, yep file is there

SQL> host dir "C:\program files\try*"

Directory of C:\program files
08/20/2008 03:00 PM 71 try.LST

Try to spool same file using long name with various syntaxes and double
quotes

SQL> spool "C:\program files\try.lst"
SP2-0556: Invalid file name.
SQL> spool "C:\program files\try"
SP2-0556: Invalid file name.
SQL> spool "C:/program files/try.lst"
SP2-0556: Invalid file name.
SQL> spool "C:/program files/try"
SP2-0556: Invalid file name.


Terry Dykstra

unread,
Aug 20, 2008, 6:39:19 PM8/20/08
to
"Malcolm Dew-Jones" <yf...@vtn1.victoria.tc.ca> wrote in message
news:48ac9620$1...@news.victoria.tc.ca...

Works for me:


/>connect atcordba@prod
Enter password: *******
Connected.
ATCORDBA/prod>spool "c:\documents and settings\test.lst"
ATCORDBA/prod>select sysdate from dual;

SYSDATE
---------
20-AUG-08

ATCORDBA/prod>spool off

When I check that folder, the file has been created. Now trying to do an
EDIT does fail:
ATCORDBA/prod>edit "c:\documents and settings\test.lst"
SP2-0556: Invalid file name.
Unable to complete EDIT command

--
Terry Dykstra


joel garry

unread,
Aug 21, 2008, 5:01:30 PM8/21/08
to
On Aug 20, 3:39 pm, "Terry Dykstra" <tddyks...@forestoil.ca> wrote:
> "Malcolm Dew-Jones" <yf...@vtn1.victoria.tc.ca> wrote in message
>
> news:48ac9620$1...@news.victoria.tc.ca...

>
>
>
>
>
> > Terry Dykstra (tddyks...@forestoil.ca) wrote:
> > : "Malcolm Dew-Jones" <yf...@vtn1.victoria.tc.ca> wrote in message
> > :news:48aa0880$1...@news.victoria.tc.ca...

Using XE on XP, I find that
spool "c:\program files\sss.lst"
edit c:\program files\sss.lst
edit 'c:\program files\sss.lst'
work, but
edit "c:\program files\sss.lst"
gives the 556 error.

See bug 7150873, something will be fixed in 11.2, don't know if it is
this, exactly.

On hp:
$ mkdir "abc def"
$ sqlplus [obscured]

SQL*Plus: Release 9.2.0.6.0 - Production on Thu Aug 21 13:52:13 2008

Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.


Connected to:
Oracle9i Enterprise Edition Release 9.2.0.6.0 - 64bit Production
With the Partitioning, OLAP and Oracle Data Mining options
JServer Release 9.2.0.6.0 - Production

SQL> edit "abc def/xyz"


SP2-0556: Invalid file name.
Unable to complete EDIT command

SQL> edit 'abc def/xyz'


SP2-0556: Invalid file name.
Unable to complete EDIT command

SQL>

jg
--
@home.com is bogus.
The revolution will not be televised, but someone will use your
internet account to check it out. http://www.internetevolution.com/author.asp?section_id=466&doc_id=161919&

0 new messages