0

I need to run SQL scripts and wanted to capture that output to a log file. I am trying to access Sybase using ISQL and below is the sample file, though only echo messages are getting printed in the log file.

Command that I am running on windows box is this:

./Test.sh > $JOBSROOT/Test/Scripts/logtest/test.log 2>&1

#!/bin/sh
#ident "%W%" 
#
echo "Trying to print"

ISQL_EOD="$ISQL -S $DB_SERVER -U $DB_DRMSUSER -P $DB_DRMSPASS -w999"

cd ${JOBSROOT}/Test/Scripts/logtest/
echo "Echo Prints"

$ISQL_EOD  << ADDE
set nocount on

select 'A HouseKeeper job'

set nocount off
ADDE

First time I am doing this hence could be wrong anywhere in this, please help me to understand it and find out the faulty line.

  • Unrelated but putting commands in strings is not a good idea. It doesn't work for complex commands. See [Bash FAQ 050](http://mywiki.wooledge.org/BashFAQ/050) for discussion about this. – Etan Reisner Jul 14 '15 at 12:13

1 Answers1

0

Seems like your command is missing a go In isql, commands are executed by issuing go on it's own line.

set nocount on

select 'EMEA VPE VOT Morning HouseKeeper job'

set nocount off

go
Michael Gardner
  • 6,406
  • 5
  • 21
  • 33
  • Yes. I noticed it just after putting this question here and then solved the problem that i was facing. However thanks for the help. – ANewDeveloper Jul 15 '15 at 05:00