sqlplus spool file

Posted on 2012-12-26
Last Modified: 2012-12-27
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?
Question by:Roberto Madro R.
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
LVL 14

Expert Comment

ID: 38722417
I guess this link has anwer to your question.

If you need another example, let me know.

Author Comment

by:Roberto Madro R.
ID: 38722449
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".
LVL 14

Expert Comment

ID: 38722455
Could you please share the code so we can take a look?
Instantly Create Instructional Tutorials

Contextual Guidance at the moment of need helps your employees adopt to new software or processes instantly. Boost knowledge retention and employee engagement step-by-step with one easy solution.


Author Comment

by:Roberto Madro R.
ID: 38722470
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"
LVL 22

Accepted Solution

Steve Wales earned 500 total points
ID: 38722504
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

Author Closing Comment

by:Roberto Madro R.
ID: 38724411
Great job sjwales & many thank

Featured Post

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article started out as an Experts-Exchange question, which then grew into a quick tip to go along with an IOUG presentation for the Collaborate confernce and then later grew again into a full blown article with expanded functionality and legacy…
Working with Network Access Control Lists in Oracle 11g (part 2) Part 1: Previously, I introduced the basics of network ACL's including how to create, delete and modify entries to allow and deny access.  For many…
This video explains at a high level with the mandatory Oracle Memory processes are as well as touching on some of the more common optional ones.
This video shows how to copy an entire tablespace from one database to another database using Transportable Tablespace functionality.

717 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question