Anyone,
I have a numbr of SQL Plus scripts that I need to run many times but each run against a different database. Each script SPOOLS the output like this:
spool c:\temp\BUILD_ASSET.lis
spool c:\temp\BUILD_WORKORDER.lis
...
etc
(each spool is a seperate script run)
The spool is at the top of each BUILD SQL Script.
Example:
set time on
SET FEEDBACK ON
SET ECHO ON
SET TIMING ON
spool c:\temp\BUILD_ASSET.lis
But I need each run to go into its own directory based on the database I am connected to. Like this:
CONNECT DB1
@C:\temp\BUILD_ASSET.SQL =====> spool c:\temp\DB1\BUILD_ASSET.lis
@c:\temp\BUILD_WORKORDER.SQL =====> spool c:\temp\DB1\BUILD_WORKORDER.lis
...
etc
CONNECT DB2
@C:\temp\BUILD_ASSET.SQL =====> spool c:\temp\DB2\BUILD_ASSET.lis
@c:\temp\BUILD_WORKORDER.SQL =====> spool c:\temp\DB2\BUILD_WORKORDER.lis
Is there a way to dynaically code this without having to create a version of the BUILD scripts for every single DB I connect to?
I would like to have one big script that executes all the individual BUILD scripts.
Seems very easy in concept but I can not see an easy way. I would appreciate any help I can get.
Thanks in advance,
Miller