Mike Matrigali wrote:
> It does seem like the best case would be for the error message system to
> somehow return a different error message for the same number if it is
> in soft upgrade vs. hard upgrade. Does the error message system support
> such a thing?
Yes, it does. If you want multiple messages with the same SQL state, you
need to add the ".<severity>.<#>" information to the error state in
SQLState.java. E.g, all these messages have SQL State 08004:
----- snip from SQLState.java ----
String LOGIN_FAILED = "08004";
String NET_CONNECT_AUTH_FAILED = "08004.C.1";
String NET_DATABASE_NOT_FOUND = "08004.C.2";
String AUTH_DATABASE_CONNECTION_REFUSED = "08004.C.3";
String AUTH_SHUTDOWN_NOT_DB_OWNER = "08004.C.4";
String AUTH_ENCRYPT_NOT_DB_OWNER = "08004.C.5";
...
----- snip -------
If, e.g., both these messages
'{0}' cannot be a column of a primary key or unique key because it can
contain null values.
'{0}' cannot be a column of a primary key because it can contain null
values.
... should have the same 42831 error code, you would need something like
this in the SQLState.java file:
String LANG_DB2_ADD_UNIQUE_OR_PRIMARY_KEY_ON_NULL_COLS = "42831.S.1";
String LANG_DB2_ADD_PRIMARY_KEY_ON_NULL_COLS = "42831.S.2";
'S' because 42831 is statement severity level (see class javadoc in
SQLState.java), while 1 and 2 are used to tell the messages apart.
messages.xml also needs to be updated, of course.