ISQL connectivity validation in script

  1. Is there a way to validate ISQL connectivity in shell script(ksh) before executing any queries..?
    2.what is the best way to handle NULL from ISQL restult assigned to a script variable ?(if ISQL connectivity fails)
rowCount=`/sybase/OCS-12_5/bin/isql -S $serverName -H $hostInfo -D $dbName -U $userName -P $passWord -b << EOF
go
set nocount on
$query
go
EOF`
  1. any specific configurations to be validated if the script is to be scheduled using cron ..?

Perhaps you could give us more.. in order to understand what puzzles you?

From the little bit of code you've given so far, what are we to assume? All the environment is set in the script?
What is this NULL from ISQL
(I know Im shortsighted with very bad eyesight but I'm trying my best so forgive me if its there...)

These are the things set within script
hostInfo=10.10.100.10:2000
serverName=myServer
dbName=myDB
userName=dbuser
passWord=dbPwd

I execute the mentioned isql snippet in dev server, and getting rowcount properly assigned to the script variable.

whereas if i execute the same snippet in the test server and getting the below error.

CS-LIBRARY error: ct_init(): network packet layer: internal net library error: Attempt to load protocol driver failed Attempting to obtain a localized error message failed.

what are all the configuration parameters i need to verify among those 2 servers..??