Validation and Verification : Length Check

As with type checks, most databases will automatically perform length checks on any entered data. The length check is a validation check which ensures that the data entered is no longer than a specified maximum number of characters. This is particularly important if a fixed length field is being used to store the data. If this is the case then any extra characters typed that made the data longer than the space available to store it would be lost. Here are some example field names and appropriate maximum lengths :

Field Name Maximum Length Valid Data Invalid Data
Title6mr, Mrs, GeorgeThe Duke Of, Sixteen
Surname15Smith, JonesSmethurst-Whately
County15England, CarThe Former Yugoslav Republic of Macedonia

Length checks are usually only performed on alphabetic or alphanumeric data.

GCSE ICT Companion 04 - (C) P Meakin 2004