Skip to Main Content

Oracle Database Discussions

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!

Turn SQL prompt off in spooled file

519926Apr 7 2008 — edited Apr 7 2008
Hi,

Quite frankly I'm at a loss here. I have Oracle 9i (Ent Ed) on AIX 5.3. I'm trying to generate a shell script that can be run outside of Oracle. I have the following in my script :

#!/bin/ksh
cd /home/oracle/toto
export ORACLE_SID=toto
export ORACLE_HOME=/opt/oracle/9iv2
rm /home/oracle/toto/del_files.sh
sqlplus "/as sysdba" <<EOF
set feedback off
set heading off
set pagesize 2000
set linesize 120
set echo off
set term off
spool /home/oracle/toto/del_files.sh
select 'rm -rf ' ||file_name from dba_data_files;
spool off
set feedback on
set heading on
set pagesize 25
set linesize 80
set echo on
set term on
/
EOF

The problem is that in my spooled file I have the 'SQL>' prompt and the sql commands and not just the rm etc lines that I want. I've tried putting the spool command before the set commands, in between the set commands and after the set commands but I'm still getting the SQL> prompt with the sql commands in my spooled file.

I've looked on Orafaq, Jonathan Lewis and any other sites that came up with sql prompt off in Google.

Its not going to be my week is it ?

Message was edited by:
mattyb
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on May 5 2008
Added on Apr 7 2008
5 comments
12,907 views