echo problem

hi all
i have little problem below is my shell script

a=`sqlplus fss_cst/fss_cst@dolp1 << EOF
SET PAGESIZE 0 FEEDBACK OFF TRIMOUT ON;
select process from lfs$ta_process where valid_to_dat=to_date('9/16/2010','mm/dd/yyyy');
EOF`
echo ${SQL}

the script name is test2.sh

when i execute this ./test2.sh nothing happen and it shows blank
but if do it in the same in database then it shows the value
pls help me regarding this

you are saving the return value in variable 'a', and not SQL...

Replace echo ${SQL} with $a and execute

hi sorry that was my mistake i changed the variable too then it is gicing such type of message below

/svc/hin5/work/deepak1/C10 > ./test2.sh
SQL*Plus: Release 10.2.0.4.0 - Production on Tue Sep 28 17:43:25 2010

Copyright (c) 1982, 2007, Oracle. All Rights Reserved.


Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options 

SQL> SQL> 2 3 4 5 6
Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

/svc/hin5/work/deepak1/C10>

Assuming that there is a table called lfs$ta_process we need to protect the dollar sign from the shell with a backslash.

You may find that after initial debugging "sqlplus -s" produces less garbage feedback.

Hi.

You might also want to use sqlplus -s

hi all
i did both of the above thing still output is coming blank :frowning:

don't know what is the problem

---------- Post updated at 07:09 AM ---------- Previous update was at 12:41 AM ----------

now i modified my script in such a way below

GetDBValue()
{
#
# Returns value from $DATABASE for the given select.
#
typeset SelectSQL=$1

sqlplus -s <<!EOF! | tr -d ' ' | read SQLValue
$DATABASE
SET PAGESIZE 0 FEEDBACK OFF TRIMOUT ON;
${SelectSQL}
!EOF!
RC=$?
}

GetDBValue " Select count(*) from gparams ; "

echo "${SQLValue}"

the name of the shell script is test4.sh here is the output

dolhin5/work/CR10 > ./test4.sh

dolhin5/work/CR10 >