Re: how to spool to C:\Documents and Settings\xzeng\My Documents?
Date: 20 Aug 2008 15:09:36 -0800
Message-ID: <48ac9620$1@news.victoria.tc.ca>
Terry Dykstra (tddykstra_at_forestoil.ca) wrote:
: "Malcolm Dew-Jones" <yf110_at_vtn1.victoria.tc.ca> wrote in message
: news:48aa0880$1_at_news.victoria.tc.ca...
: > sasworks (xuzengpj_at_gmail.com) wrote:
: > : 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???
: >
: > 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.
: >
: Use double quotes instead of single quotes around the spoolfile name.
: --
: 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.Received on Wed Aug 20 2008 - 18:09:36 CDT