I'm aware of the overhead. Our motivation is to split the "logic" into two parts. Some conditions are easily implemented in SQL ( Status='A' ) for "active" records, for example. Others not so much... if we have a field with a string and want to insert a "default" into the other table without modifying the source table it gets kind of ugly (... ISNULL(NULLIF(...)) ).

In other words: Do the selection in SQL and the transformation in DataFlex code.

Wel'll probably just use DataDictionaries with SQL-filters, which should do the trick as well. The version with SqlBindFile felt convenient though and we did not want to change the DDs/Add more DDOs, etc. if not needed.

For huge tables we already use the "Insert into <target> Select ... from <source>" approach and as filter and selections get more sophisticated, the code readability degrades fast. Imagine adding records from two tables into a third one, avoiding duplicates, etc, transforming empty values to defaults (depending on values of other fields).

I'll give MARS a shot. At a first glance, this seems to solve our problem, but a quick try was not yet successful. I have a bit more reading to do
And I'll also give the cConnection-object a try. So far I was trying to create a second connection manager, but that does not seem to work.
Michael's DLL sounds good, but I assume "SQLBindFile" would not work with that?
Performance is importing but even our "huge" databases are relatively small (usually <1 million entries ). Most queries are executed within seconds (if we don't fetch every record)