I am using SEARCH ALL in one of my program. For SEARCH ALL, the data should be in Ascending or decending order. I just want to know, if we dont sort the data, will we get any error or the SEARCH ALL does not function properly.
SEARCH ALL - is a binary search & the table must be sorted ( ASCENDING/DESCENDING KEY clause to be used & data loaded in this order) before using SEARCH ALL.
What should be the sorting order for SEARCH ALL
It can be either ASCENDING or DESCENDING. ASCENDING is default. If you want the search to be done on an array sorted in descending order, then while defining the array, you should give DESCENDING KEY clause. (You must load the table in the specified order).
The results of a SEARCH ALL operation are predictable only when:
v The data in the table is ordered in ASCENDING/DESCENDING KEY order
v The contents of the ASCENDING/DESCENDING keys specified in the WHEN clause provide a unique table reference.