Results 1 to 2 of 2
  1. #1
    Join Date
    Nov 2006
    Posts
    19

    Question Unanswered: 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

  2. #2
    Join Date
    Jun 2003
    Location
    Toronto, Canada
    Posts
    5,516
    Provided Answers: 1
    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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •