?
Solved

sqlplus spool file

Posted on 2012-12-26
6
Medium Priority
?
839 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
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 

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 2000 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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

Have you ever had to make fundamental changes to a table in Oracle, but haven't been able to get any downtime?  I'm talking things like: * Dropping columns * Shrinking allocated space * Removing chained blocks and restoring the PCTFREE * Re-or…
How to Unravel a Tricky Query Introduction If you browse through the Oracle zones or any of the other database-related zones you'll come across some complicated solutions and sometimes you'll just have to wonder how anyone came up with them.  …
This video explains at a high level about the four available data types in Oracle and how dates can be manipulated by the user to get data into and out of the database.
This video shows how to copy an entire tablespace from one database to another database using Transportable Tablespace functionality.
Suggested Courses

771 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