I dont think that can be achieved using dynamic where expressions. I will probably suggest to put it on a stored procedure and run it as a command or as a table. It will be faster (sql execution) and will save you headaches with DA/RO.
We have a GUI application which allows all kinds of filtered access to some DB data
In 90% of the cases we want SELECT FROM A (and some joines) which is fast
In 5% of the cases we want to add some slow filter condition C1
In 5% of the cases we want to add some other slow filter condition C2
We don’t mind slow lookup in 10% of the cases but we don’t want to loose fast lookup in 90% of the cases.
Furthermore we don’t want to combine C1 and C2
Our remains the same so our DA interface remains the same.
So the SQL subclause is exactly what I need.
How can we keep our fast query but also support some advanced queries and have the same DA interface on the client side?
I would need to test if this works, the problem is that we have about 30 lines of code that create an SQL expression using the DA4’s DynamicWhere object. We would need to rewrite this with all the dangers of making a mistake (SQL string encoding, etc.)
Support for subqueries via DynamicWhere would definately be the cleanest solution IMO.