Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
I got saddled with someone's work and I have very little idea on what to do.
Basically, there are X number of .sql files that have to be run with a specific value for the wirecenter. Then, once the sql script is run, the output has to be captured to a csv file. The platform is oracle 8 on a solaris box (don't have version).
So I am supposed to write a script that:
1. Fires off all the .sql scripts.
2. Passes them the value of the wire center which is used to query the DB.
3. Capture the results in a CSV file.
4. Highlight how much time it took the queries to execute.Anyone want to help me with this?
Thanks!

a sample of the .sql script showing how thhe wire center variable is handled would help.
"A CSV file" - All results are contained in a single file?

Well, those scripts have to be modified by someone.
But here is what I did:
#! /bin/sh
sqlplus -s scott/tiger@DatabaseName << ENDSQL
WHENEVER SQLERROR EXIT 5
WHENEVER OSERROR EXIT 10SPOOL ${SCI_PORT_OLD.csv}
@create table SCI_PORT_OLD.sql
SPOOL OFFSPOOL ${CREATE_CLINK.csv}
@Create clink.sql
SPOOL OFFSPOOL ${FMS_Before_Picture.csv}
@FMS Before Picture.sql "Value_for_Wirecenter"
SPOOL OFFSPOOL ${Update_FMS_PORT.csv}
@update FMS.SCI_PORT.sql
SPOOL OFFSPOOL ${FMS_After_Picture.csv}
@FMS After Picture.sql "Value_For_Wirecenter"
SPOOL OFFSPOOL ${REPORT_FMS_Fallout.csv}
@REPORT_FMS_Fallout.sql "Value_For_Wirecenter"
SPOOL OFFSPOOL ${REPORT_FMS_NON_CONVERSION.csv}
@REPORT_FMS_Non_Conversion.sql "Value_For_Wirecenter"
SPOOL OFFSPOOL ${DROP_VANC_CLINK.csv}
@DROP VANCOUVER_CLINK.sql
SPOOL OFFEXIT;
ENDSQL
What do you think?

![]() |
![]() |
![]() |

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |