Solved

sqlplus spool file

Posted on 2012-12-26
6
823 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.
  • 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
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: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

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.

Question has a verified solution.

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

Suggested Solutions

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…
Using SQL Scripts we can save all the SQL queries as files that we use very frequently on our database later point of time. This is one of the feature present under SQL Workshop in Oracle Application Express.
This video shows how to copy a database user from one database to another user DBMS_METADATA.  It also shows how to copy a user's permissions and discusses password hash differences between Oracle 10g and 11g.
Via a live example, show how to restore a database from backup after a simulated disk failure using RMAN.

770 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