Re: Pass Return Code to Shell

From: Tommy Wareing <p0070621_at_brookes.ac.uk>
Date: 1996/04/11
Message-ID: <4kit9b$qsa_at_cs3.brookes.ac.uk>#1/1


In article <4kfaop$d4g_at_newsbf02.news.aol.com>, Candeman1 says...
>In article <4jrokg$2jl_at_news.dca.net>, jennings_at_dca.net (Ed Jennings)
>writes:
>>I'm running SQL scripts within a Kourne Shell script. If the
>>SQL encounters an error, I want the return code to be propagated
>>out to the shell return code ($?). Does anyone know how to do this??
>
>In the SQLPlus script, as the first line:
>
>whenever sqlerror exit sql.sqlcode

But remember that the return code will be truncated to 8 bits (so 1403 gets returned as 123, since 1403=5*256+123)

-- 
 _________________________   __________________________________________
/  Tommy Wareing          \ /  I've been looking for an original sin,  \
|  p0070621_at_brookes.ac.uk  X   One with a twist and a bit of a spin    |
\  0865-483389            / \     -- Pandora's Box, Jim Steinman       /
 ~~~~~~~~~~~~~~~~~~~~~~~~~   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Received on Thu Apr 11 1996 - 00:00:00 CEST

Original text of this message