Database Reference
In-Depth Information
Figure 11.12. The completed Business Rule Specifications sheet for the new business
rule
Validation Tables
As you define field-specific business rules, there will be instances in which a rule imposes
a constraint that defines a distinct set of valid values for a given field's range of values.
(This affects the field's Range of Values element in its field specification.) This set of val-
ues commonly comprises a relatively fixed number of entries, and the values themselves
willrarelychange.Ifthenumberofentriesisratherhigh,however,youmightdiscoverthat
it's going to be slightly difficult for you to implement this rule. For example, you'll prob-
ablyrunoutofroomveryquicklywhenyouattempttoenumerateeachofthevalueswithin
theRangeofValueselement ontheFieldSpecifications sheet,andimplementing theentire
set of values within the RDBMS could prove to be somewhat complicated. You can avoid
problems such as these by storing all of the values in a validation table.
What Are Validation Tables?
As you learned in Chapter 3 , Terminology ,” a validation table (also known as a lookup
table ) stores data that you specifically use to implement data integrity. You won't often in-
sert,update,ordeleteanyrecordswithinthetableonceyoupopulatethetablewiththedata
you require. Validation tables usually (but not always) comprise two fields: The first acts
as the primary key and is what you'll use to help you enforce data integrity, and the second
issimplyanon-keyfieldthatstoresasetofvaluesrequiredbysomeotherfieldinthedata-
base. Figure 11.13 shows two examples of validation tables.
Search WWH ::




Custom Search