You can reference the SYSCS_DIAG.ERROR_MESSAGES diagnostic table directly in
a statement. For example:
SELECT * FROM SYSCS_DIAG.ERROR_MESSAGES
All users can access this diagnostic table, whether or not the database has
authentication and SQL authorization enabled. See "Configuring user
authentication" and "Configuring user authorization" in the
for more information.
The table has the columns shown in the following table.
Columns in the SYSCS_DIAG.ERROR_MESSAGES table
For the columns in the SYSCS_DIAG.ERROR_MESSAGES table, this table provides its data type, its length in bytes, whether it is nullable, and a description of its contents.
Column Name
Type
Length
Nullable
Contents
SQL_STATE
VARCHAR
5
true
The SQLState of the SQLException (that is, the
value returned by SQLException.getSQLState()).
MESSAGE
VARCHAR
32672
true
The error message (that is, the value returned by
SQLException.getMessage()).
SEVERITY
INTEGER
10
true
The
code for the severity (that is, the value returned by
SQLException.getErrorCode()).