Uniface User Forum

 View Only
  • 1.  Retrieve not like

    Posted 07-06-2022 06:42
    Hi community,
    strange enaugh this is the first time in years I have to do a retrieve in Uniface, "not like" equivalent
    so the goal is to have retrieved data with first character not "I" and not "O" for the same field

    in sql we easily do in this way:

    select * from table where field not like "I%" and field not like "O%"

    neither in the read u_where clause or retrieve directly in field, I can make it work

    for example if I want to to a like clause I write in the code:

    field.table = "I·*·|O·*"

    this is correctly translated by the Uniface SQL driver into like I% or like O%

    but if I want to do "NOT like", trying this way:

    field.table = "·!I·*·!O·*"

    is translated wrongly into not like I* and not like O* ,so translated with the * instead of the % symbol. that occurs the same way if I do this in the u_where clause

    my bad (and ugly) workaround is to write this in the u_where clause:

    read u_where (field.table < "I" | field.table > "Izzzzzzz") & (field.table < "O" | field.table > "Ozzzzzzz")

    that points me to insert a condition the read trigger to work as a simple read, or that one

    do you all have any suggestion?

    thank you
    Simone

    ------------------------------
    Simone Pecchenino
    Labinf Sistemi Srl
    IT
    ------------------------------


  • 2.  RE: Retrieve not like

    Posted 07-06-2022 08:29
    menwhile I found another (not too good) workaround

    read where "field not like 'I%' and field not like 'O%'"

    using "where" instead of "u_where"

    ------------------------------
    Simone Pecchenino
    Labinf Sistemi Srl
    IT
    ------------------------------



  • 3.  RE: Retrieve not like

    PARTNER
    Posted 07-06-2022 10:22
    Can't you do something like the following?

    field.table = "·!I·*·&·!O·*"

    ------------------------------
    David Reed
    Tribal Group
    ------------------------------



  • 4.  RE: Retrieve not like

    Posted 07-07-2022 02:39
    that seem to work even if the driver continue to translate it into:

    I/O function: S, mode: 0, on file/table: TABLE index: 1 >=
    Where ((FIELD Not Like 'I*' And FIELD Not Like 'O*'))

    with * instead of %

    thank you both!

    ------------------------------
    Simone Pecchenino
    Labinf Sistemi Srl
    IT
    ------------------------------



  • 5.  RE: Retrieve not like

    ROCKETEER
    Posted 07-07-2022 03:08
    This is actually the where clause as generated by Uniface. For details see:
    This is not the SQL generated by the driver.

    I hope this helps.

    ------------------------------
    Daniel Iseli
    Principal Technical Support Engineer
    Uniface Services
    Rocket Software, Switzerland
    ------------------------------



  • 6.  RE: Retrieve not like

    Posted 07-06-2022 15:27

    This should work - (with obvious GOLD's in front of !, = and *)
    "!=I*&!=O*"

    Regards,
    Knut



    ------------------------------
    Knut Dybendahl
    ------------------------------