I want to compare data from 2 sub tables (from 2 records) where each sub table can have 200/300 entries, and each sub table entry can have 10 data items. One field from each will be the key that should match, i.e. get the correct entry, and then all 10 data items in the entries need to be compared. If any one of the data items do not match, then want to report it as unmatched (data item name and value for record 1 and record 2)
I initially saved all entries as single lines in a 2 table and then merge them to check the match. That timed out.
I had look at Temp Tables, but just like Sub Table of type Sub, you cannot find within in
This leads me to thinking that the only possible way would be for dumping record 1 sub table entries into a new table with sub table of type main, and then loop through the second sub table and find the entry in the new sub table main using the key field.
Record1.Subtable(all entries) : insert_subtable_record into NewTable.SubTableMain, (at end Update the NewTable Record so it is persisted?)
Loop Record2.subtable: for each key_value Fetch Record from New.SubtableMain where keyfield = key_value
Is that what is suppose to work?
and will it not just be better to write the Record1.subtable records to a table with equal structure to the subtable. I.e. make it a table rather than a sub table of type sub table main?