Query by form

Author: gianni.sandigliano@unifacesolutions.com (gianni)

Hi Unifacers, query by form is currently described on CHM helpfile as: An action in which a retrieve profile is entered by the user in one or more fields of the outermost entity of a form, which allows the retrieval of one or more occurrences matching the specified profile. Wildcards (profile characters) are allowed. Uniface joins the fields containing retrieve profiles by an AND or OR operator, depending on the profiles. To support a request from a customer I've tried to type into a form: field1 = "<GOLD>*ASTRING<GOLD>*" field2 = "<GOLD>|<GOLD>*ANOTHERSTRING<GOLD>*" but URuntime insist to generate SQL as: ((FIELD1 Like '*ASTRING*') And (FIELD2 Like '*ANOTHERSTRING*')) I was hoping the <GOLD>| at beginning of field2 should enable a joining OR instead of the usual joining AND but it was NOT... Is the only solution to have OR clauses somehow managed to build a dedicated parser to manage u_condition? Thanks for any input Gianni

3 Comments

  1. Hi Gianni, I'm wondering - is 'field1' the pk? I just tried it here as you described - BUT - my 'field1' was the pk so I had to OR the search in field1 with itself;

    field1 = <gold*>blah<gold*><gold|><gold*>blah<gold*> field2 = <gold|><gold*>anotherblah<gold*>

    and that worked... Knut


    Author: Knut (knut.dybendahl@gmail.com)
  2. Knut said ... I'm wondering - is 'field1' the pk? ...

    Yes...both are part of the PK! After many years I always fall in this trap... Thanks Knut Gianni


    Author: gianni (gianni.sandigliano@unifacesolutions.com)
  3. You're welcome!Cool


    Author: Knut (knut.dybendahl@gmail.com)