shellexceptionisql

Throwing Shell script's Stored procedure Exception Back to the Caller


i have a Shell Script A which calls Shell Script B which calls the Stored procedure within ISQL within it. The Exception in Shell Script B's Stored procedure has to be thrown back to the Original Shell Script A. Any idea how to do this?


Solution

  • Here is the solution:

    iSQL > $output_file
    status='cat $output_file'
    if [$status== "Login Failed"]; then
    echo "Login Failed error"
    elif  [$status== "Permission Denied"]; then
    echo "Permission Denied error"
    else [$status== "Connection error"]; then
    echo "Connection Denied Error"
    fi
    
     Or
    
    $status='grep "permission denied" $tmp.txt | sed 'g/ /d' | cut -d":" -f2'
    echo $status