Re: VARCHAR and trailing space

From: Andrus Adamchik (andru..bjectstyle.org)
Date: Thu May 25 2006 - 10:36:55 EDT

  • Next message: Andrus Adamchik: "Re: Let me introduce myself..."

    VARCHARs normally should not be trimmed (at least not by the
    framework). It as assumed that database does not pad VARCHARs with
    spaces, as this goes against the definition of VARCHAR (unlike CHARs
    where the behavior is undefined). So trailing spaces are assumed to
    have meaning to the user. This is why I was surprised by your report
    that MS Access does in fact pads VARCHARs. Maybe it simply doesn't
    support this data type?

    Andrus

    On May 25, 2006, at 8:52 AM, Øyvind Harboe wrote:

    > What's the correct behaviour for VARCHAR and trailing space, i.e.
    >
    > foo.setVarCharProp("abc ");
    >
    > for:
    >
    > foo.getVarCharProp().equals("abc")
    > foo.getVarCharProp().equals("abc ")
    >
    > Which should yield true or false?
    >
    >
    > --
    > Øyvind Harboe
    > http://www.zylin.com
    >
    >



    This archive was generated by hypermail 2.0.0 : Thu May 25 2006 - 10:37:23 EDT