Re: Oracle 8.1.6 ProC and error codes , C++

From: Sydney Palmer <sydpalm_at_home.com>
Date: Sat, 21 Jul 2001 21:46:06 GMT
Message-ID: <3B13D640.B7E_at_home.com>


Thomas Roemke wrote:
>
> > > if (0 > sqlca.sqlcode)
> > > {
> > > printErrorMessageAndExit();
> > > }
> > >
> > What's wrong with that? It has never hurt anyone!!!
>
> Sybrand, I kindly ask you to post serious articles. I'm a programmer
> not a hacker, therefore I want to figure out how the information that
> is provided by the ProC database interface can be used in the way
> I described in my original posting.
>
> > You'r just asking for it!
> > By reading the Pro*C manual
>
> What do you think I did ?
>
> > which will tell you you can use exec sql whenever to address your errors
> > It will also tell you the only 'warning' is -1403, meaning no data found
>
> nope, I disagree.
>
> > There simply is no header file with all the error codes, which is probably
> > on purpose as the error codes *and messages* are provided by the server.
>
> well, but since there are programmers outside, not just only hackers, the
> probability is high that someone else already has such an include file ...
>
> Thomas

It does seem to go against the grain to imbed hardcoded return codes in your applications; however, I think that there is a tacit agreement between us and Oracle NOT to change those values, since the results would be catastrophic.

If you go through the error descriptions, you'll probably find that there are only a few that you care about (want to trap and perform some special dispensation or recovery), and the rest will fall under the category of 'other/fatal/unknown'.

Why not create a small header file with your own constants for those few, and trust that your code won't have to change much for unstable return codes. Besides, a header file with ALL of the possible return codes would be a pretty huge affair. And, you can perform a certain amount of interpretation of the message-number and message-text itself to determine the source and/or type of error.

Yours,

Geoff Houck
hksys_at_home.com Received on Sat Jul 21 2001 - 23:46:06 CEST

Original text of this message