Variable constraint messages: Example 4

Previous Next

Example 4

For transitional constraints, you may want to refer to the old values:

SELECT    p.first_name
,         p.last_name
,         OLD( p.discount )    old_discount
FROM      person p
WHERE     discount > OLD( discount ) + 5

For this constraint, you can specify the message:

The personal discount for <p.first_name.value> <p.last_name.value> currently is <old_discount.value> %.
This percentage must not increase by more than 5% at a time.

 

See also

Constraint messages