Variable constraint messages: Example 3

Previous Next

Example 3

In the Travel Agency, the business rule: "The return date of a scheduled tour must match the preset duration of the tour" is implemented by a corrective constraint:

UPDATE    schedtour st
SET       st.return_date =
(
    SELECT    st.start_date + t.num_days - 1
    FROM      tour t
    WHERE     t.destination = st.destination
    AND       t.tour_type = st.tour_type
)

For this constraint, you may specify the message:

The scheduled tour to <st.destination.value> on <st.start_date.value> ends on <st.return_date.value>.

This will lead to an information message at run-time.

 

See also

Variable constraint messages