Fixed length records | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
A file where each records is of the same length is said to have fixed length records. Some fields are always the same length (eg Postcode is always 7 characters). Some fields may need to be
'padded out' so they are the correct length Advantage : Access is fast because the computer knows where each record starts. It follows that processing all the data in a file will be fast. Eg If each record is 120 bytes long then
Disadvantage : Using Fixed length records, the records are usually larger and therefore need more storage space and are slower to transfer (load or save) or transmit down a network. Example : Any information retrieval system (Eg Train time-table program) where information needs to be accessed quickly.
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
In the Example
...the field lengths (in bytes) may be defined as ...
Each record would be 46 bytes long. The first record of the example file would be stored as ...(each box represents one byte of storage)..
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||