We help IT Professionals succeed at work.

spool usage

wasabi3689
wasabi3689 asked
on
Medium Priority
553 Views
Last Modified: 2012-08-26
I have the following line working but I want to put the log file into a folder like myfolder
But the folder is not created previously.

When I run the program, it will auto create the folder?


spool create_my_views.log

Can I put this line like below?

spool myfolder\create_all_views.log
Comment
Watch Question

CERTIFIED EXPERT
Most Valuable Expert 2012
Distinguished Expert 2019
Commented:
Maybe just try it?  It will either work or it won't.

The answer is: No.  It will not create the folder for you.

You can issue the HOST command and create it from inside the script.

Note: sqlplus doesn't really like folders with spaces in them.  At least it didn't used to like them.

Author

Commented:
If I pre-create the folder "MyFolder" before I run  spool, still use this line

spool myfolder\create_all_views.log

it works? I mean  the log file will go to MyFolder?
CERTIFIED EXPERT
Most Valuable Expert 2012
Distinguished Expert 2019

Commented:
You could have tried this and had your answer in less time than it took to post this and wait for a reply.

>>>I mean  the log file will go to MyFolder?

Yes
Peter ChanProblem resolver

Commented:
If I pre-create the folder "MyFolder" before I run  spool, still use this line

spool myfolder\create_all_views.log

it works? I mean  the log file will go to MyFolder?

Yes, please put this
spool c:\myfolder\create_all_views.log
CERTIFIED EXPERT
Most Valuable Expert 2012
Distinguished Expert 2019

Commented:
HuaMinChen,

This had already been posted.  Please review previous posts before posting.

Your post also adds the drive letter.  This may not be what is wanted and can lead to errors.  If they want the output in a sub- folder from the 'current' folder, the full qualification will not work.

Author

Commented:
I want the output .log go to its folder, not come out to the same folder as stored the .sql files. Otherwise, it will go to the same folder with all. sql files
CERTIFIED EXPERT
Most Valuable Expert 2012
Distinguished Expert 2019

Commented:
>>I want the output .log go to its folder, not come ou

I understand this.  Adding the folder or fully qualifying the path will work.

Have you not tested it yet?

Author

Commented:
not yet. will do later

Explore More ContentExplore courses, solutions, and other research materials related to this topic.