hi i am writing the simple unix shell script as follows. What sort of error handling should i handle and how do i fail the script in case of error? Is there any thing such as EXCEPTION when others that i can use here to log the exception and fail the script?
I see that script can fail for two reasons...1) couldnt connect to db 2) spool error
#!/bin/sh
sqlplus -s scott/tiget@ORCL<<EOF
set head on
set feedback off
SET NEWPAGE 0
SET SPACE 0
SET ECHO OFF
SET FEEDBACK OFF
SET TERMOUT OFF
SET PAGESIZE 0
SET LINESIZE 500
SET TRIMS ON
set verify off
set colsep ','
spool /usr/path2/cust.csv
select 'usr_id' ||','||'customer_id' from dual
union all
select usr_id||','||customer_id from vw_usr_cust
/
exit
EOF