How to handle NULL value output from ISQL command?

I am using ISQL command in ksh script.
Suppose if i get NULL value from the query which i run,how can i handle it?

I am getting a NULL result set and the following error is coming.

############### output of isql command for getting the sum of JEs ################

-----------
        NULL

(1 row affected)
############ Checking if count is blank ###########
NULL
retrieveCheck.ksh[159]:  ^J NULL : 0403-009 The specified number is not valid for this command.

The code is:

blank=""
isql  -UUSER -PPW -SSERVER -i$tempSQL2 -w1000 -o$sumOfJEOutputFile
retval=$?
echo $retval
if [[ $retval != 0 ]]; then
            echo "Failed to connect to the Archive Database" | mail -s "ERROR OCCURED:Database connection Failed" "akanksha.kumari@libertymutual.com" 
            exit 0
else
            echo "Database connection successful."
fi
echo "coming out of isql command"
echo "############ output of isql command for getting the sum of JEs ################"
cat $sumOfJEOutputFile

egrep -v "row affected|rows affected|------|^                 |return status" $sumOfJEOutputFile > $actualCount
#######################################################################
##     Assigning the total number of JE count to a variable count 
#######################################################################
count=$(cat $actualCount | tr -s "\t" " ")
echo "############## Checking if count is blank #################"
echo $count
if [[ $count -eq $blank ]]; then ## In this line error is coming line number 159
echo "Count is Blank."
exit 0
else
echo "count is not blank"
fi

So i want to know how can i handle this null result set and send a mail to notify that null value is coming.

Thanks
Akanksha

Why dont you handle this at sql level, with something like below (oracle code)

select NVL(ename, 'DUMMY') from emp;

I am using Sybase server...
The problem is that i want to send a mail if value is null

Since you are writing the output to a file, If the file contains only that value, you can check the file size and email if it is 0 byte

But if the file contains the output as :

-----------
        NULL

(1 row affected)

How can it be 0 bytes?

---------- Post updated at 05:43 AM ---------- Previous update was at 04:36 AM ----------

I found a solution for this thanks