Correlatives

Top  Previous  Next

 

A correlative is an expression in an A or S-type dictionary item that derives a value from data in a database record. Although similar in concept to the preferred I-type dictionary items, correlatives are less powerful and more difficult to maintain. They are provided in QM to aid migration of applications from other multivalue environments. New developments should use I-type items instead and it is recommended that correlatives should be converted to I-types as part of the migration process.

 

There are two styles of correlative:

 

A-correlatives are algebraic expressions and are relatively easy to understand.

 

F-correlatives are written in reverse Polish notation which makes them difficult for less experienced developers to understand.

 

On other multivalue databases, correlatives are processed interpretively and A-correlatives are translated into their equivalent F-correlative format at the start of a query for improved performance. On QM, correlatives are compiled in much the same way as I-type expressions so the potential minor performance advantage of writing an F-correlative directly is lost. The query processor will compile correlatives automatically when they are first used. The COMPILE.DICT (CD) command can be used to force a compilation.