Change to behaviour of EQUAL search - E4000047 - 21 October 2004

This enhancement is an updated dp4srvr.w32 for 4.621 and 4.525 which includes a change to the behaviour of the fetch() function when the EQUAL flag is specified. The purpose of the change is to fix a problem that can arise when using "equal and backwards" searched in QAB.

When the EQUAL flag is specified, the fetch function returns a record, if any exist, where all the key match the keys specified in the record passed to the fetch function. If a secondary index is in use then it is possible that there is more than one such record. In this case the database manager has in the past always returned the first such record. This may be undesirable, for example, it causes a problem in QAB when "equal and backwards" search is specified, because only the first matching record will be processed, and not later matching records.

The change to the behaviour is that if both EQUAL and PREV are specified at the same time, then the EQUAL search returns the last matching record, rather than the first. However, it should be noted, that if there are no matching records then the fetch will return a PREV record, for which the keys do not match - if only records with matching keys are required you should specify the DEPTH flag, and pass the appropriate depth, (or in C++ simply pass the appropriate value for depth).

DP4 Version Compatibility

4.621

Downloads

621a.zip and 525a.zip on the FTP site includes the executable files for this and all other 4.621 compatible enhancement.