Executing a Oracle SQL statement in a UNIX script

Hi All,

I need to select one column from a table based upon the passed in parameter.

I tried this:

sqlplus -silent $MISP_USER << EOF
set feedback off;
set verify off;
set sqlprompt ""

SELECT mail_flag
FROM dailyjobs
WHERE job_name = '$1';
exit 0
EOF
exit 0

and then i tried by executing vflag=`mailflag Load_Day1`

but it throws the error

echo $i
SP2-0306: Invalid option. Usage: CONN[ECT] [logon] [AS {SYSDBA|SYSOPER}] where <logon> ::= <username>[/<password>][@<connect_string>] | / SP2-0306: Invalid option. Usage: CONN[ECT] [logon] [AS {SYSDBA|SYSOPER}] where <logon> ::= <username>[/<password>][@<connect_string>] | / SP2-0306: Invalid option. Usage: CONN[ECT] [logon] [AS {SYSDBA|SYSOPER}] where <logon> ::= <username>[/<password>][@<connect_string>] | / SP2-0157: unable to CONNECT to ORACLE after 3 attempts, exiting SQL*Plus

Please help me to fix this issue.
Many Thanks.

Ganga

try this:

sqlplus -h

You'll see 'silent' is not a valid option.