|
-
Try something like this:
sqlplus ${OP_CONNECT_STRING}@${OP_ORA_INST} @sqls/sel_logical_dt.sql > logical_dt.log
rc=$?
if [ $rc -eq 0 ]
then
ANSWER=`cat logical_dt.log`
else
# In this case there will be an error
ANSWER=""
fi
echo $ANSWER
==============================
Don't forget in your sql:
set heading off
set pagesize 0
set feedback off
set verify off
set termout off
set timing off
set wrap on
WHENEVER SQLERROR EXIT SQL.SQLCODE
==============================
Without error-detection:
ANSWER=`sqlplus ${OP_CONNECT_STRING}@${OP_ORA_INST} @sqls/sel_logical_dt.sql`
Regards
Ben de Boer
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|