Solved

sqlplus spool file

Posted on 2012-12-26
6
829 Views
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?
0
Comment
Question by:Roberto Madro R.
[X]
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
6 Comments
 
LVL 14

Expert Comment

by:ajexpert
ID: 38722417
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
0
 

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".
0
 
LVL 14

Expert Comment

by:ajexpert
ID: 38722455
Could you please share the code so we can take a look?
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

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"
SpoolSQLfileDate.bmp
0
 
LVL 22

Accepted Solution

by:
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
0
 

Author Closing Comment

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

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Introduction A previously published article on Experts Exchange ("Joins in Oracle", http://www.experts-exchange.com/Database/Oracle/A_8249-Joins-in-Oracle.html) makes a statement about "Oracle proprietary" joins and mixes the join syntax with gen…
How to Create User-Defined Aggregates in Oracle Before we begin creating these things, what are user-defined aggregates?  They are a feature introduced in Oracle 9i that allows a developer to create his or her own functions like "SUM", "AVG", and…
Via a live example show how to connect to RMAN, make basic configuration settings changes and then take a backup of a demo database
This video shows how to Export data from an Oracle database using the Datapump Export Utility.  The corresponding Datapump Import utility is also discussed and demonstrated.

730 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