Re: SQL.SQLCODE

From: Chuck Hamilton <chuckh_at_ix.netcom.com>
Date: 1996/02/04
Message-ID: <4f343u$7p_at_cloner4.netcom.com>#1/1


tkyte_at_us.oracle.com (Thomas J Kyte) wrote:

>Problem is UNIX, the following is from man -s 2 wait:
 

>
> If the child process terminated due to an _exit() call,
> the low order 8 bits of status will be 0 and the high
> order 8 bits will contain the low order 8 bits of the
> argument that the child process passed to _exit(); see
> exit(2).
>
>Only an 8 bit number is ever returned from exit(n) to wait(pid). The
>sql.sqlcode is fairly meaningless (unmappable) to an oracle error code. For
>example: select * from XXX; results in ORA-942 which is 0x3AE, which if you
>strip off the high bits is 0xAE which is decimal 174, which is what the shell
>will report back to you (sql*plus exits with 942 however, the wait() command
>which is what you shell is using only gives you back the lower 8 bits).

Thanks again Tom!

It looks like SQL.SQLCODE is pretty much useless in a UNIX environment for returning codes back to the shell. I'll just have to stick with 'EXIT FAILURE'. That'll probably make the shell easier to write anyway.

--
Chuck Hamilton
chuckh_at_ix.netcom.com

If at first you don't succeed, sky-diving isn't for you.
Received on Sun Feb 04 1996 - 00:00:00 CET

Original text of this message