[Stackoverflow] [Progress OpenEdge ABL] Is there a way to conditionally apply an inner join using dynamic queries in Progress?

Status
Not open for further replies.
U

user1982125

Guest
I am trying to inner join a table with another table but have the join only apply if there are conditions on the right table other than the primary index field on the right table linking to a field on the left table. For example, suppose I have a Customer table and a Contact table and a query is structured the following way:

FOR EACH Customer NO-LOCK [optional conditions], FIRST Contact NO-LOCK WHERE Contact.ContactID EQ Customer.ServiceContactID [optional conditions]

If a particular Customer's ServiceContactID didn't have a corresponding record in the Contact table, that Customer would be excluded from the results set. I don't want that customer to be excluded from the results set if there are no optional conditions for the Contact section of the query.

In the part of our codebase I'm working with, I'm not able to conditionally add the join of the Contact part of the query based on the values being used for the optional conditions. The query has to stay the same except for the conditions sections which are automatically built using the values that are passed to the framework. Is there a way to do this in Progress?

Continue reading...
 
Status
Not open for further replies.
Top