Hi Friends,
From the documentation, SET TERMOUT OFF controls the output of the commands executed from a script and it has no effect on commands executed interactively.
I have a shell script in which i try to connect to database and do execute SQL statements.
/home/applas> cat msr.sh
SQL_LOGIN_PASSWD="APPS/APPSDEV"
TABLE=v\$instance
ORACLE_SID=`sqlplus -s /nolog << EOF
Set termout off
connect $SQL_LOGIN_PASSWD
set heading off
set feedback off
set pagesize 0
select instance_name from $TABLE;
exit
EOF`
echo "ORACLE_SID: $ORACLE_SID"
/home/applas>
When i execute the script, the output is
/home/applas> sh msr.sh
ORACLE_SID: Connected.
ASODEV01
/home/applas>
In the above output, i donot want the text "Connected." i.e. the output should be
ORACLE_SID:ASODEV01
The option SET TERMOUT OFF is not working in this scenario meaning that it is treating this as interactive mode.
Is there a way to achieve this?
Regards,
Sreekanth