I have an error# table that I created using this old code:
SET VAR vErrNum INT = 1
WHILE vErrNum < 10000 THEN
OUTPUT messages.$$$
SHOW ERROR vErrNum
OUTPUT SCREEN
LOAD ErrorMessages FROM messages.$$$ AS FORMATTED USING ErrorMessage 1 240
UPDATE ErrorMessages SET errorno = .verrnum WHERE COUNT = LAST
SET VAR verrnum = (.verrnum + 1)
ENDWHILE
After a particular line of code I'll do a
SET VAR vChkError = .xError
and I'm hoping that vChkError contains an error code that matches the table.
However, when inserting into a table, I'm getting an error# 2227 which is not a
valid message# in that table, and it is a constraint error message. When doing
this at the R> prompt the exact message given is
-ERROR- Cannot insert - value does not exist in CustPart. (2510)
Message 2510 IS in my table, but it is under #2510, not 2227. So I manually
added 2227 as a constraint violation. Is there a way to trap constraint
error#s similar to this? Or is there just one error 2227 saying that it
violates a constraint?
Karen