Cloudscape Exception Messages and SQL States
Page 3 of 3

SQLState and Error Message Reference

Common Exceptions

SQLStates for some common exceptions:

  • deadlock

    40001

  • foreign key violation

    23501

  • check constraint violation

    23L02

  • duplicate value violating unique or primary key constraint

    23500

  • duplicate value violating unique index

    23L01

  • truncation error

    22001

  • user authorization error

    XJ006

  • user authentication error (no permission to access database)

    04501

  • user authentication error (no write access)

    22502

NOTE: Cloudscape reserves the right to change the SQLState of Cloudscape errors.

Getting a Complete List

Cloudscape provides a VTI class that returns a complete, locale-sensitive list of SQLStates and corresponding messages and severity levels. This class is COM.cloudscape.vti.ErrorMessages, aliased as ErrorMessages. Query the VTI for a complete list, or use a WHERE clause to find messages of a particular category. For example:

-- get a complete list, in order by SQLSTATE
SELECT *
FROM NEW ErrorMessages() AS EQ
ORDER BY SQL_STATE

-- get a list of only the most severe errors
SELECT *
FROM NEW ErrorMessages() AS EQ
WHERE SEVERITY > 40000
ORDER BY SEVERITY, SQL_STATE

NOTE: Cloudscape reserves the right to change the SQLState of Cloudscape errors.