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

From: Thomas Roemke <TRoemke_at_gmx.de>
Date: Sat, 21 Jul 2001 21:45:24 GMT
Message-ID: <9evagc$tdu$01$1_at_news.t-online.com>


"Reidel Jogie" <reidel_at_usa.net> schrieb im Newsbeitrag news:qRDQ6.33958$G5.7378552_at_news1.rdc1.md.home.com...
> The values of sqlca.sqlcode correspond to the 'ORA' error codes (and
> descriptions) in the Oracle Error Messages manual.

Well, I know that the ora error messages are listed there, but from my "programmer's" point of view that doesn't help much.

Some observations:

    First, I don't think that the people that developed the Oracle PL API thought

    the action

[Quoted]         if (0 > sqlca.sqlcode)
        {
            printErrorMessageAndExit();
        }

    would be the only action that makes sense after ANY error.

    Second, I don't think the same guys thought, a programmer would have to read

    the content of thousands of error descriptions to know which one to list in a

    switch statement like the following:

        if (0 > sqlca.sqlcode)
        {
            switch (sqlca.sqlcode)
            {
                case -1: /* error 1 */  .... break;
                case -2: /* error 2 */ .... break;
                   ......
                default: .... break;
            }
        }

    and furthermore - from oracle version to version - the programmer would have to read

    the manual again and would have to check if there are new error codes that ...

    Finally, why would I have different error codes returned by the sqlca.sqlcode

    anyway, if I cannot use them? sqlca.sqlcode could just be a bool stating

            "an error has occured"

    and the error text can be used for logging purposes since it contains the error code

    as its first part ....

Due to this observations, I think, there must be another way to handle these error conditions, but I simply don't know it.

To the ProC programmers outside: How do you handle this in your programs?

Thomas Received on Sat Jul 21 2001 - 23:45:24 CEST

Original text of this message