Connecting to sybase via shell script.

Hi All,

I was able to connect to sybase in shell script and also able to run few sql queries, something like this,

#!/usr/bin/ksh -x

temp=`echo "select name from sysobjects where type = 'U'"`
results=`isql -SDS_SERVER-UAdhocUser -Pha12 <<EOF
set rowcount 6
$temp
go
EOF`
line_count=0
echo "${results}" | while read line; do
echo "Line $((line_count = line_count + 1)) is ${line}"
done

But if suppose sql queries are stored in file called "sql_query.txt", then how should it be executed. (Above code is taken from this forum only :slight_smile: )

Thanks in advance for help.

Change line #1 to read

temp=`cat sql_query.txt`