2 Replies Latest reply on Apr 26, 2018 5:11 PM by _Dylan_

    Where is the default spool location?

    _Dylan_

      I have a sql script that does some spooling: c:\spool_test\run.sql

       

      SPOOL output.txt
      SELECT * FROM DUAL;
      SPOOL OFF
      

       

      When I open the run.sql file and execute, it outputs as expected.

       

      When I run (as statement or script) with @c:\spool_test\run.sql in a worksheet, I see the select-results in the script output but I get no file (or at least not one in spool_test, nor does output.txt come up in a file search) and I get no error/warning. If I add the directory to the spool, it works. My assumption is without a directory, it's defaulting to some directory I don't have write-permissions on, instead of the directory of the script. Is this expected? I don't have a working version of SQL Plus handy on my work machine so I haven't been able to compare.

        • 1. Re: Where is the default spool location?
          Glen Conway

          In a Windows 10 environment, when using SQL Developer 18.1, the spooled output goes to...

          C:\Users\<myuserid>\AppData\Roaming\SQL Developer

          which is the directory shown in the Help -> About -> Properties tab for both the ide.pref.dir and ide.user.dir properties.

           

          When using SQLcl 18.1.1, the spooled output goes to a directory specified in an environment variable.  Since I have the following three environment variables set to the same value in my setup script, off-hand I am not sure which controls the spool output location...

          SQLPATH

          SQL_PATH

          STARTUP_SQLCL

          Hope this helps

          1 person found this helpful
          • 2. Re: Where is the default spool location?
            _Dylan_

            Very helpful. Thanks for this. I'm working on something that will end up in version control and shared with others. They can dump it to a different location so I was hoping to keep everything as directory-and-session var-agnostic as possible.