merge foundsets

Hi,

I have two foundsets based on the same table.

I would like to merge the two into one new foundset. Can that be done ??

Regards,

This can be done using the foundset query, something like:

new_foundset_query = "select table_id from table where table_id in ("+foundset_query_1+") or table_id in ("+foundset_query_2+")"

Thanks Michel,

I thought of this option too.

But this means another roundtrip to the database.
If I can merge the foundsets directly I do not need to go to the database.

Regards,

A foundset is defined by it’s underlying SQL () the from clause, with joins, the where clause, the ordering etc.

So, merging 2 foundsets means getting the 2 SQL’s combined. There’s no way to do that, except for the way michel says, unless…

If you have one foundset you can extend the set of records in there by a find/search with the correct arguments for the search command. So, if you have “know” what defines the second foundset, that might also be a way.

But, in both cases, there will be a roundtrip to query just the PK’s again. Any record data that was already loaded will not be re-queried.

Paul

Thanks Guys,

Will try this.