I was trying to store the value of a sqlplus select into a Unix environment variable. It worked fine in one Unix server, but the same script failed with syntax error for VALUE in the other server. Both servers are the same version solaris and running same Oracle 8i version. Has anyone used the trick below for Unix env variables and had any similar trouble? Also, are there other ways of accomplishing the same thing?
Here is the script
VALUE=`sqlplus -s user/password <
set pagesize 0 feedback off verify off heading off echo off
select max(c1) from t1;
if [ -z "$VALUE" ]; then
echo "No rows returned from database"