Quick question that I couldn’t come up with a method/ability to solve on my own.
I have a set of records provided by a 3rd-party. I have previously received many such sets, including a unique ID which is saved in our ADA database. This new set is proposing revisions to some of the previously received meta-data and the only value which should never change is the ID.
I currently do the following:
Read in the entire file, push the unique identifier (and other fields) into a blank object which matches the previously stored object, and then call a sub-program to perform:
define-data parameter using returnobj /* contains an object handle called return-object local using externalrecordsview local 01 #unique-id (a10) 01 #ext-rec-obj handle of object end-define #unique-id := return-object.unique-id find external-records-view with external-records.unique-id = #unique-id #ext-rec-obj := null-handle create object #ext-rec-obj of class external-records reset return-object move by name external-records to return-object /* moves the fields end-find end
Sorry, the above is a typed paraphrase of a DB method, not tested or even stowed - just to show the concept. I am using a single field (#unique-id) to retrieve an object which matches that unique-id for further manipulation.
What I would LIKE to be able to do is to speed up the DB reading process. In effect, since I already have a known #unique-id for each record, I can push them into an array of values (#unique-id-array(*)). Can I use the FIND command in adabas to do a one-time DB call (potentially multi-fetch) to grab an array of the objects matching the IDs in #unique-id-array rather than returning each object after each Adabas call?
The only method I can think of is to make some complicated logical statement (if (examine #unique-id-array(*) for external-record.unique-id giving #number) > 0?) and use it in the WHERE clause, or use it to skip each record that fails the condition. However, if I am processing only a few records this would still result in reading the entire DB by ISN and evaluating WHERE / condition so it would be hugely inefficient.
Thanks for taking the time,