in reply to Re: sqlplus or DBI
in thread sqlplus or DBI
Ooh, no! You don't want to do that!
The system status code is only one byte wide, and so can only handle values in the range 0 to 255. Picking a random example, do you know what error code 244 refers to? Yes, that's right: "integrity constraint (%s.%s) violated - child record found"
The point here is that the particular error I've quoted above is actually code 2292, which any good mod function can tell you is 256*8+244. The multiples of 256 get thrown away by the operating system.
Now, what do you think happens if you get the error "space quota exceeded for tablespace '%s'"? Yes, that's right: it's code 1536, which is exactly 256*6. And the system neatly truncates this to 0.
Actually, the best solution I found was to use WHENEVER ERROR EXIT 2, and terminate the script with EXIT 1. That way, you can tell if the script never started (exit code 0), completed successfully (code 1), or failed (code 2).
--
Tommy
Too stupid to live.
Too stubborn to die.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Re: sqlplus or DBI
by insensate (Hermit) on Nov 19, 2002 at 14:49 UTC | |
by x31forest (Novice) on Nov 19, 2002 at 16:33 UTC | |
by tommyw (Hermit) on Nov 19, 2002 at 16:16 UTC |