select count(*) in sqlplus into variable unix shell

Need to select count(*) from table to check for zero result in unix script

One way:

#!/bin/ksh
myvariable=$( 
echo "set feed off
set pages 0
select count(*) from table;
exit
"  | sqlplus -s username/password@oracle_instance
)
echo "found count = $myvariable"

Hi, I tried using your codes, but I keep getting this error: