AW: How do I query on null or blank field?

From: Peter Schröder (Peter.Schroede..reenet-ag.de)
Date: Wed Mar 07 2007 - 02:24:45 EST

  • Next message: Randy Leonard: "Cayenne Classic vs. Cayenne JPA"

    you may also try the expression.fromString with the sql-skripting language of cayenne:
    http://cwiki.apache.org/confluence/display/CAYDOC/Scripting+SQLTemplate

    http://cayenne.apache.org/1_2/grammar/ExpressionParser.html wich seems to be a dead link!
     

    -----Ursprüngliche Nachricht-----
    Von: Frank [mailto:farocc..otmail.com]
    Gesendet: Dienstag, 6. März 2007 20:34
    An: use..ayenne.apache.org
    Betreff: How do I query on null or blank field?

    Hello,

    Using the ExpressionFactory, I am trying to locate records based on this sql:

    WHERE TYPE_ADMIT = '{s_admittype}' AND
    (active = 1) AND (LEN(LTRIM(ASSIGNED_ROOM_BED)) = 0) OR
    TYPE_ADMIT = '{s_admittype}' AND (active = 1) AND (ASSIGNED_ROOM_BED IS NULL)

    Is ExpressionFactory the best way to do this?
    I cannot seem to limit my records based on a field that can be blank or null.

    Thanks for the help.

    Frank



    This archive was generated by hypermail 2.0.0 : Wed Mar 07 2007 - 02:25:16 EST