Previous Topic: $ERRORCLASS and $ERRORTYPE CodesNext Topic: $ERRORDB2PLAN (DB2 Only)


$ERRORCONSTRAINTNAME Function

This function provides the constraint name when the error is a referential integrity violation.

Note: $ERROR functions only return meaningful data in the error procedure or in a procedure or subprogram invoked by the error procedure. In the case of a database error, $ERROR functions can also return meaningful data in the scope of a WHEN ERROR clause. You do not have to pass the $ERROR functions as parameters.

For CA Datacom/DB native access, the $ERROR‑CONSTRAINT‑NAME function returns the constraint name for a database return code of 94, with a subcode of 31, 34, or 35. For all other errors, this function returns a value of N/A.

For SQL access, the $ERROR‑CONSTRAINT‑NAME function returns the constraint name from the error message text for SQL codes ‑175, ‑176, and ‑260.

This function has the following format:

$ERROR‑CONSTRAINT‑NAME