in reply to Problem with DBI placeholders

Whitespace is handled differently in versions of the same database. I recently sent Tim Bunce a patch for a test in DBD::Oracle regarding whitespace handling in Oracle9i (which differs from Oracle8, which differs from Oracle7, etc.)

My recommendation is to not use trailing and/or preceding whitespace in your data, for several reasons. This isn't even the most important one. More important is that if you have a trailing space in one row and not in the other, you can't find equality in your SQL.

------
We are the carpenters and bricklayers of the Information Age.

Please remember that I'm crufty and crochety. All opinions are purely mine and all code is untested, unless otherwise specified.

Replies are listed 'Best First'.
Re: Re: Problem with DBI placeholders
by mpeppler (Vicar) on Jan 28, 2004 at 16:06 UTC
    More important is that if you have a trailing space in one row and not in the other, you can't find equality in your SQL
    I would qualify that statement and say that it is true for certain database systems (and Oracle in particular). For Sybase trailing whitespace is not significant: either the column is of type char(), in which case it is fixed width and is always padded with whitespace, or it is of type varchar(), in which case trailing whitespace is ignored (although inseting a zero-length string will be converted to a single whitespace).

    Michael