I'm writing a script which accesses an Oracle database - I'm using a here document to do a select to a spool file. But for some reason it's not going past the terminating label. Here's the code - obviously I've changed the id,pwd & instance name:
-------------------------------------------------------
sqlplus -s my_id/my_pwd@my_instance <<LABEL | tee -a ${LOGFILE}
set trimspool on
set heading off
set pagesize 0
set feedback off
spool list_dbfiles_\$ORACLE_SID;
select FILE_NAME from dba_data_files;
spool off
exit
LABEL
echo HERE !!!!!!!!!!!!!!!
exit
-------------------------------------------------------
When I run this the output is written to the spool file OK but I never see the "HERE !!!!!!!!!!!!!!" text. I'm writing the output to a log file but I've tried removing that bit of code & it makes no difference.
Any idea what I could be doing wrong?
Thanks, Chris
-------------------------------------------------------
sqlplus -s my_id/my_pwd@my_instance <<LABEL | tee -a ${LOGFILE}
set trimspool on
set heading off
set pagesize 0
set feedback off
spool list_dbfiles_\$ORACLE_SID;
select FILE_NAME from dba_data_files;
spool off
exit
LABEL
echo HERE !!!!!!!!!!!!!!!
exit
-------------------------------------------------------
When I run this the output is written to the spool file OK but I never see the "HERE !!!!!!!!!!!!!!" text. I'm writing the output to a log file but I've tried removing that bit of code & it makes no difference.
Any idea what I could be doing wrong?
Thanks, Chris