Core iTOps Tube

Friday, 29 June 2012

Shell Scripting Function call return value

Hi I have a function :




Code:


Make_Report()

{

    trx_report=`sqlplus -s $conn_str << @@

                      set echo off;

                      set pages 0;

                      set feedback off;

                      set verify off;

                      select srv_trx_s_no, subscriber_no,

                      to_char(SYS_CREATION_DATE,'MM/DD/YYYY HH24:mi:ss')

                      from q1 where rownum <=5 order by 1

                      ;

                      @@`

}


If there are no rows return by this function i want to stop my execution there and no email should be sent , but if some rows are retuned by this function i want to send a alert email , i tried using $? , but no luck , please help.




No comments:

Post a Comment