sqlplus spool file

Roberto Madro R.
Roberto Madro R. used Ask the Experts™
on
My Oracle sql script runs fine,  but I'd like to add to datetime to the spooled file, is there a way of doing that?
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®

Commented:
I guess this link has anwer to your question.

If you need another example, let me know.

https://forums.oracle.com/forums/thread.jspa?threadID=28956
Roberto Madro R.Programmer Analyst

Author

Commented:
Yep, it works, but now I'm getting the literal customer ID, "CustomerID12262012", as the name of the spooled file instead of the value of "Customer ID".

Commented:
Could you please share the code so we can take a look?
Success in ‘20 With a Profitable Pricing Strategy

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden using our free interactive tool and use it to determine the right price for your IT services. Start calculating Now!

Roberto Madro R.Programmer Analyst

Author

Commented:
Due to the nature of the information, I can only attach the script as a picture with some column headers blanked out, no sweat however, you'll get the idea, and as for the "customer ID", it's actually a "Donor ID"
SpoolSQLfileDate.bmp
Senior Database Administrator
Commented:
If you want both parameters in the name of the output file, you actually want the spool command to be this:

spool c:\&donor_id&todaysdate

Alternatively, you could also put a period between the parameters (it actually outputs as the same thing - you'd need a double period if you wanted a single period in the file name)

spool c:\&donor_id.&todaysdate
Roberto Madro R.Programmer Analyst

Author

Commented:
Great job sjwales & many thank

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial