
Bruce wrote:
> Actual error code numbers/letters.  I think the new elog levels will
> help with this.  We have to decide if we want error numbers, or some
> pneumonic like NOATTR or CONSTVIOL.  I suggest the latter.

Since there is an actual standard for error codes, I would strongly suggest 
to adhere. The standardized codes are SQLSTATE a char(5) (well standardized
for many classes of db errors). Also common, but not so standardized is SQLCODE 
a long (only a very few are standardized, like 100 = 'no data found').
And also sqlca. Also look at ecpg for sqlcode and sqlca.

A Quote from dec rdb:
--------------------------------------------------------------------
   o  SQLCODE-This is the original SQL error handling mechanism.
      It is an integer value. SQLCODE differentiates among errors
      (negative numbers), warnings (positive numbers), succesful
      completion (0), and a special code of 100, which means no
      data. SQLCODE is a deprecated feature of the ANSI/ISO SQL
      standard.

   o  SQLCA-This is an extension of the SQLCODE error handling
      mechanism. It contains other context information that
      supplements the SQLCODE value. SQLCA is not part of the
      ANSI/ISO SQL standard. However, many foreign databases such
      as DB2 and ORACLE RDBMS have defined proprietary semantics and
      syntax to implement it.

   o  SQLSTATE-This is the error handling mechanism for the ANSI/ISO
      SQL standard. The SQLSTATE value is a character string that is
      associated with diagnostic information. To use the SQLSTATE
      status parameter, you must specify the SQL92 dialect and
      compile your module using DEC Rdb Version 6.0.
--------------------------------------------------------------------

Andreas

Thu, 18 Jul 2002 10:01:20 +0200
"Zeugswetter Andreas SB SD" <ZeugswetterA@spardat.at>
Re: error codes
Insisting on Andreas suggestion,  why can't we just prefix all error message 
strings with the SQLState code?  So all error messages would have the format

CCSSS - xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

Where CCSSS is the standard SQLState code and the message text is a more 
specific description.

Note that the standard allows for implementation-defined codes, so we can have 
our own CC classes and all the SSS subclasses that we need.


-- 
Fernando Nasser
Red Hat - Toronto                       E-Mail:  fnasser@redhat.com
2323 Yonge Street, Suite #300
Toronto, Ontario   M4P 2C9


Tue, 26 Nov 2002 18:57:22 -0500
Fernando Nasser <fnasser@redhat.com>
Re: error codes