The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
.
google unix.com




View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #5 (permalink)  
Old 10-02-2006
cero cero is offline
Registered User
  
 

Join Date: Aug 2006
Posts: 56
Another way would be:
Code:
#!/usr/bin/ksh
RET=`sqlplus -silent rep/Ndk38f7@dw <<END
set pagesize 0 feedback off verify off heading off echo off
select decode(d1,d2,'No rows',to_char(d1)||' '||to_char(d2)) from
(select trunc(max(chg_dt)) d1 from NOT_SCHEDULED_INSTALL),
(select trunc(sysdate) d2 from dual);
exit;
END`
if [[ "$RET" = "No rows" ]] ; then
   # do something
else
  # do something else
fi
Let the Oracles decode-function compares for you.