Shell Script Variables

HI guys

I need to store the output of a sql query in a variable, can you tell me how to do that

eg) select count(*) from s_escl_req

$count = count(*) from s_escl_req

how would i store the count(*) from the sql statement in a variable called $count.

thanks

this is the way to store the output of the 'date' command in variable 'myDate' using ksh:

#!/bin/ksh

myDate="$(date)"

echo "here is myDate->[${myDate}]"

thanks, i was able to do it this way..

You can also do it in the following way :

   count=`{
           print "set pages 0"
           print "set feedback off"
           print "count(*) from s_escl_req;"
           } | ${ORACLE_HOME}/bin/sqlplus -s ${user}/${password}@${TNS_ALIAS}`

Best regards,
Nir