Variable constraint messages: Example 5

Previous Next

Example 5

It is also possible to refer to object names and column prompts in constraint messages.:

,          ABS( )   debt
FROM       order o
,          customer c
WHERE      o.cust_id =
AND < 0

For this constraint, you can specify the message:

<> <> is rejected. <> <> has an outstanding debt of <debt.value> US dollars.

The message displayed might for instance be:

"Order 12455 is rejected. Customer Jones has an outstanding debt of 12,364.12 US dollars".

Although meta information about objectName and Prompt is constant, the maintainability of the messages increases when using this mechanism. Hence, changing a prompt name of a column will automatically have effect on the constraint messages in which this prompt is used. Only meta information defined in the Definer can be used.

For Domain Constraints object names and column prompts are useful, since this is variable information and there can be more than one column based on the same domain.


See also

Constraint messages