If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > Grabbing SQL code after deactivate for error handling

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 11-20-06, 10:45
brdholman brdholman is offline
Registered User
 
Join Date: Nov 2006
Posts: 19
Question Grabbing SQL code after deactivate for error handling

UDB 8.2, Solaris

Hi,

I've not done scripting and need to account for particular SQL codes coming back after db2 commands. Our current code is:

if [[ $rc -eq 0 ]]; then
echo "Deactivate database completed SUCCESSFULLY for $DBNAME on `date`." >> $
LOGFILE 2>&1
else
echo "\n!!! ERROR !!! -- deactivate db FAILED for database $DBNAME on `date`!
\n" >> $LOGFILE 2>&1
error_page
error_email
exit 4
fi

Can I say [ $rc -eq SQL1496W ] in an additional else clause or do I pull it some other way?

Thanks for your help,
brdholman
Reply With Quote
  #2 (permalink)  
Old 11-20-06, 14:05
n_i n_i is offline
:-)
 
Join Date: Jun 2003
Location: Toronto, Canada
Posts: 4,449
Quote:
Originally Posted by brdholman
Can I say [ $rc -eq SQL1496W ] in an additional else clause or do I pull it some other way?
Nope. You'll have to parse the CLP output yourself.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On