Comparing data from 2 subtables of type sub

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?

First question: Why is the data in a Subtable Sub? Nextworld does not recommend using those table types for business applications. If the data were in a Subtable Main this would be a pretty simple task.

That said, I don’t have a better recommendation than the ideas you’ve already considered.

Hi Ian, The sub table is actually one of many in the Applications table. Currently there is no tool that can show what differences exists between a Application in one lifecycle and the next. Given the situation that sometimes you are on a “big” development, and then need to fix something quickly on an application involved, then only coming back much later to the application itself, and now need check out again, and reapply your old changes, it waste quite a bit of time figuring things out. So I am building a tool that can easily compare two applications in different lifecycles, and all the “items” in the application are stored in sub tables. Hence the requirement.

Anyway, I will let you know what I came up with, and what worked, when we are back at work…

That sounds like a useful tool to be in the base product. I recommend submitting an enhancement request if one hasn’t already been entered.

1 Like