Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Doubt on SET TERMOUT OFF option

Sreekanth MunagalaSep 16 2011 — edited Sep 19 2011
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
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Oct 17 2011
Added on Sep 16 2011
14 comments
10,843 views