473,387 Members | 1,485 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Spooling more than one file

35
I have several .sql file that I am runing from the dos prompt using echo. I want to spool the log files of each of the .sql files into one. The way I have it now, the current log file overwrites the previous. Can somebody please help me? This is very urgent

Thanks

Expand|Select|Wrap|Line Numbers
  1.  
  2. echo spool c:\temp\oracle\script_output.txt >  c:\temp\oracle\tests.sql
  3. echo @c:\temp\oracle\Create_Config.sql      >> c:\temp\oracle\tests.sql
  4. echo spool off                              >> c:\temp\oracle\tests.sql
  5. echo exit;                                  >> c:\temp\oracle\tests.sql
  6. echo                                        >> c:\temp\oracle\tests.sql
  7.  
  8. sqlplusw tryadmin/admin@trydb @c:\temp\oracle\tests.sql
  9.  
  10. echo spool c:\temp\oracle\script_output.txt   > c:\temp\oracle\tests.sql
  11. echo @c:\temp\oracle\text.sql  >> c:\temp\oracle\tests.sql
  12. echo spool off                                >> c:\temp\oracle\tests.sql
  13. echo exit;                                    >> c:\temp\oracle\tests.sql
  14. echo                                          >> c:\temp\oracle\tests.sql
  15.  
  16. sqlplusw tryadmin/admin@trydb @c:\temp\oracle\tests.sql
  17.  
Apr 4 '08 #1
4 2275
Dave44
153 100+
I have several .sql file that I am runing from the dos prompt using echo. I want to spool the log files of each of the .sql files into one. The way I have it now, the current log file overwrites the previous. Can somebody please help me? This is very urgent

Thanks

Expand|Select|Wrap|Line Numbers
  1.  
  2. echo spool c:\temp\oracle\script_output.txt >  c:\temp\oracle\tests.sql
  3. echo @c:\temp\oracle\Create_Config.sql      >> c:\temp\oracle\tests.sql
  4. echo spool off                              >> c:\temp\oracle\tests.sql
  5. echo exit;                                  >> c:\temp\oracle\tests.sql
  6. echo                                        >> c:\temp\oracle\tests.sql
  7.  
  8. sqlplusw tryadmin/admin@trydb @c:\temp\oracle\tests.sql
  9.  
  10. echo spool c:\temp\oracle\script_output.txt   > c:\temp\oracle\tests.sql
  11. echo @c:\temp\oracle\text.sql  >> c:\temp\oracle\tests.sql
  12. echo spool off                                >> c:\temp\oracle\tests.sql
  13. echo exit;                                    >> c:\temp\oracle\tests.sql
  14. echo                                          >> c:\temp\oracle\tests.sql
  15.  
  16. sqlplusw tryadmin/admin@trydb @c:\temp\oracle\tests.sql
  17.  
can you create one file which starts the spool, setting echo on and have that script call all the others that you need to run?

so have like control.sql and within it call all the other scripts that need to be run. as long as none of the others have exit in them they should run through sqlplus as one large script. I use a similar technique.
Apr 4 '08 #2
kwartz
35
Thanks for the help, I first used append but then changed to what you suggested and it worked perfectly, I really appreciate your help.
Apr 7 '08 #3
kwartz
35
I have a log file that is generated from numerous .sql file. I am trying to add a line in the .cmd file that runs these .sql should there be an error in in the log file. This is what I have so far

Expand|Select|Wrap|Line Numbers
  1.  
  2. echo spool c:\temp\script_output.txt           > c:\temp\Initialize.sql 
  3. echo @c:\temp\tst1.sql                             >>c:\temp\Initialize.sql 
  4. echo @c:\temp\tst2.sql                             >>c:\temp\Initialize.sql
  5. echo spool off                                           >>c:\temp\initialize.sql 
  6. echo exit;                                                >>c:\temp\Initialize.sql 
  7. echo                                                      >>c:\temp\Initialize.sql
  8.  
  9.  
  10. sqlplusw aduser/admin@tstdb @c:\temp\Initialize.sql
  11.  
  12. FIND "ORA-" "C:\Program Files\DRS\MDIG3\db\script_output.txt"
  13.  
This displays all errors in the log file, however I just want to "echo" errors found .
Can someone please help me with this? This is quite urget need to get it done by cob.
Thanks
Apr 7 '08 #4
amitpatel66
2,367 Expert 2GB
Duplicate Threads merged for better management of forum

MODERATOR
Apr 8 '08 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

114
by: Maurice LING | last post by:
This may be a dumb thing to ask, but besides the penalty for dynamic typing, is there any other real reasons that Python is slower than Java? maurice
1
by: Ken Tucker | last post by:
Help! I'm recursing through 10,000 directories where some have as few as 5 files and others have 100's. I'm then performing a few things based on the modify date of the file. Needless to say,...
6
by: shailesh kumar | last post by:
Hi, I need to design data interfaces for accessing files of very large sizes efficiently. The data will be accessed in chunks of fixed size ... My data interface should be able to do a random...
0
by: Zentil | last post by:
While printing reports Spooling of print document size get increased into larger size ie the document size is 260kb but on spooling it increased to 268mb. but this is happening in some systems...
116
by: Mike MacSween | last post by:
S**t for brains strikes again! Why did I do that? When I met the clients and at some point they vaguely asked whether eventually would it be possible to have some people who could read the data...
0
by: ARUNB | last post by:
I have to write a procedure using spooling techniques where the procedure will take some data from a table and will write it in a file defined in the spool command. I'm giving the...
4
by: Surek | last post by:
Hi, I want to spool data from my query to a csv file. i have done it. My query returns more than 31,000 rows. It takes more than 1 hour to transfer data to the csv file. Can anyone please...
3
by: jaeden99 | last post by:
I was wandering if nyone has a script to move files older than x days old? i've seen several to delete, but I don't want to delete. I would like to create a backup of the files first verify with...
41
by: c | last post by:
Hi every one, Me and my Cousin were talking about C and C#, I love C and he loves C#..and were talking C is ...blah blah...C# is Blah Blah ...etc and then we decided to write a program that...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.