The array structure is basically not supported by relational design, and thus always causes some problems when used with any product designed to work with relational database designs.
Most people with a System/38 background have at one time or another had serious problems when attempting to process some form of "array structure" with products like QUERY, PC/TRANSFER or SQL.
In reality however, array constructs are very common in database designs, particularly in applications that have originally come from System/3/34/36 computers.
Additionally, many system designers justifiably include array constructs into design as a legitimate way of improving the performance of an application.
However, it must be emphasized that the use of array constructs in database files is NOT considered to be the best long term strategy in database design terms.
The array processing facilities within LANSA are provided as a concession to reality. Array structures within files are very common and provide better system performance than fully normalized relational database designs.
The presence of these facilities should not be construed in any way as encouraging the use of array structures in database designs.
Whenever hardware resources permit, a fully relational design will always yield a simpler, easier to use, easier to maintain and longer lasting solution.
To aid in processing arrays, the following sections describe 3 differing techniques for processing array structures at the RDML level.
Since the newer and more efficient technique 3 was introduced, techniques 1 and 2 are now largely redundant. They remain in this guide for historical documentation only.
For more details about technique 3 you should also refer to the DEF_ARRAY (Define Array) command in the LANSA Technical Reference Guide.
In all the following examples, it is assumed that the database file involved contains a character field called CYR that is 84 bytes long.
It actually contains an array of 12 x 7,2 signed positive decimal fields.
Where array constructs contain packed decimal data, slight modifications to technique 2 would be required to ensure that it works correctly.
Techniques 1 and 3 should work on packed decimal data without any major modifications.
Even though the techniques described only deal with one 12 position numeric array, it should be very easy to extrapolate the techniques to handle more than one array, to handle arrays with a different number of entries, or to handle arrays containing alphanumeric data.