Turn SQL prompt off in spooled file
519926Apr 7 2008 — edited Apr 7 2008Hi,
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