Solved

sqlplus spool file

Posted on 2012-12-26
6
821 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:codedigger
  • 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:codedigger
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
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 

Author Comment

by:codedigger
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:codedigger
ID: 38724411
Great job sjwales & many thank
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Join & Write a Comment

Suggested Solutions

Working with Network Access Control Lists in Oracle 11g (part 1) Part 2: http://www.e-e.com/A_9074.html So, you upgraded to a shiny new 11g database and all of a sudden every program that used UTL_MAIL, UTL_SMTP, UTL_TCP, UTL_HTTP or any oth…
Background In several of the companies I have worked for, I noticed that corporate reporting is off loaded from the production database and done mainly on a clone database which needs to be kept up to date daily by various means, be it a logical…
This video shows, step by step, how to configure Oracle Heterogeneous Services via the Generic Gateway Agent in order to make a connection from an Oracle session and access a remote SQL Server database table.
This video shows setup options and the basic steps and syntax for duplicating (cloning) a database from one instance to another. Examples are given for duplicating to the same machine and to different machines

757 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now