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

From: Frank (farocc..otmail.com)
Date: Wed Mar 07 2007 - 11:20:18 EST

  • Next message: jerome moliere: "Re: Improvement ? code generation (templates)"

    Thanks Mike,

    That worked.

    Frank
    ----- Original Message -----
    From: "Mike Kienenberger" <mkienen..mail.com>
    To: <use..ayenne.apache.org>
    Sent: Tuesday, March 06, 2007 3:02 PM
    Subject: Re: How do I query on null or blank field?

    > orExp(
    > ExpressionFactory.matchExp("ASSIGNED_ROOM_BED", null),
    > ExpressionFactory.matchExp("ASSIGNED_ROOM_BED", "")
    > )
    >
    > On 3/6/07, Frank <farocc..otmail.com> wrote:
    >> 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 - 11:20:58 EST