sql script to invoke another sql script and log results to a .log file
Posted by: francis chinalu
Date: June 28, 2012 08:19AM

i have a c-shell scrip that connects to a mysql database database through and invokes a sql script which in turn invokes another sql script to run a query and return a report

#!/bin/csh


set MYSQL=${MYSQL_HOME}/mysql


set REPORT=${CLEADM_HOME}/Scripts/DataValidation/EOreport.sql


${MYSQL} ${CLEDBUSER} <${REPORT}

then within the eoreport.sql i invoke another script like so

source IERSs.sql

and finally in the IERSs.sql script i need to log the results to a log file but it is not working

SELECT * FROM TB_EARTHORIENTATIONPARAMETER_UI INTO OUTFILE '/vobs/tools/Scripts /results.log'

This is not working. All i see is the results of the query printed to the xterm(im using tcsh on solaris and the database is mysql client). Am i missing something?

i have even done research about the tee command that is supposed to pipe in you input and output i to the file that you specify as follows

tee /vobs/tools/Scripts/DataValidation/results.txt

SELECT * FROM TB_EARTHORIENTATIONPARAMETER_UI;

but this still outputs results to the screen and leaves my result.txt file empty. What am i missing ?



Edited 1 time(s). Last edit at 06/28/2012 09:29AM by francis chinalu.

Options: ReplyQuote


Subject
Written By
Posted
sql script to invoke another sql script and log results to a .log file
June 28, 2012 08:19AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.