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 > Shell Programming and Scripting
.
google unix.com



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
why shell script fails? tahir23 Shell Programming and Scripting 4 08-25-2008 09:46 AM
why script fails sometime? tahir23 UNIX for Advanced & Expert Users 10 08-21-2008 06:04 PM
why shell script fails tahir23 Shell Programming and Scripting 4 08-21-2008 10:37 AM
file <filename> fails kingskar UNIX for Advanced & Expert Users 2 08-14-2006 09:07 AM
Script fails JStone Shell Programming and Scripting 8 08-10-2006 12:00 AM

 
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #1 (permalink)  
Old 01-06-2009
ali560045's Avatar
ali560045 ali560045 is offline
Registered User
  
 

Join Date: Oct 2007
Posts: 328
log file when the script fails !

i have a script that will retrive some info from database. The script is working fine but i have to add new feature in it when the script fails or retrive null result it should reflect in the log file.

below the script AMR_Inactive.sh
Code:

while read i
do

connect1=`sqlplus -silent amit/qwerty@edna.world <<END
set pagesize 0 feedback off verify off heading off echo off
SELECT meter.X_UDC_ASSET_ID
 FROM
    SIEBEL.S_ASSET Meter,
    SIEBEL.S_ASSET SDP,
    SIEBEL.s_asset_rel ARSM,
        SIEBEL.S_ADDR_PER Premise,
        SIEBEL.S_ASSET Route,
        SIEBEL.s_asset_rel ARSR
 WHERE
        ARSM.par_asset_id = SDP.row_id AND
        ARSM.asset_id = Meter.row_id AND
        ARSM.relation_type_cd = 'SDP-METER' AND
        ARSM.x_rel_status = 'Active' AND
     SDP.PER_ADDR_ID = Premise.row_id AND
        ARSR.par_asset_id = Route.row_id AND
        ARSR.asset_id = SDP.row_id AND
        ARSR.relation_type_cd = 'ROUTE-SDP' AND
        ARSR.x_rel_status = 'Active' AND
                Premise.X_CLIENT_PRMSE_ID = '$i';
exit;
END`
echo "Completed for $i" 
echo "$connect1" 
done < TNS_AMRI_INACTIVE.txt
contents of TNS_AMRI_INACTIVE.txt
Quote:
0002034694
if suppose for this data the script returns null result i should get the info "No rows returned" in my log file.i m runnig the script using crontab

AMR_Inactive.sh > AMR_Inactive.log 2>&1

Last edited by ali560045; 01-06-2009 at 02:26 AM..
 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 09:36 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0