Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

sql script to invoke another sql script and log results to a .log file

Status
Not open for further replies.

randokan

MIS
Jun 28, 2012
2
US
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 ?
 
I forgot to add more detail. The environment variables used in this thread are MYSQL_HOME which i have defined to point to the location of the mysql prompt. The CLEDBUSER contains the log in information to the database which is (-uusername -ppassword -Ddatabase)
 
I think that the right forum to ask is MySQL one, not SQL Server ;-)

Borislav Borissov
VFP9 SP2, SQL Server
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top