1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. Anuncie Aqui
    Anuncie aqui você Também: fdantas@4each.com.br

[Stackoverflow]

Discussão em 'StackOverflow' iniciado por fdantas, Janeiro 17, 2021.

  1. fdantas

    fdantas Administrator Moderador

    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...

Compartilhe esta Página