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!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

Sqlplus SET TERMOUT OFF does not work in shell script redirection

1007321Dec 5 2014 — edited Dec 5 2014

Hello,

I've got a sqlplus .sql script in which I use the

SET TERMOUT OFF

instruction, before running a select statement that dynamically creates another

statement, spooled inside another .sql script that I run right away...

I used this SET TERMOUT OFF but this time included in a shell where sqlplus is

invoked as follows:

#!/bin/bash

...

$ORACLE_HOME/bin/sqlplus -s / as sysdba <<EOF

set ver off

... [other instructions]

set termout off

set heading off

spool /tmp/xtmp.sql

select 'select ... from ... where sid='||sid||'... ' from v\$session...;

spool off

@/tmp/xtmp.sql

...

quit

EOF

but this time when running my shell the result of the statement between the two

spool commands gets outputed: why ?? In my .sql file above the dynamic SQL is

not displayed, in my shell script well indeed, I can't understand why...

I would like to get rid of this output: is it possible ?

Thanks a lot for any hint.

Regards,

Seb

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jan 2 2015
Added on Dec 5 2014
3 comments
2,470 views