Subject RE: [firebird-support] Is this a bug? (FB 2.1 <...> 2.1.2)
Author Helen Borrie
At 07:23 PM 27/04/2009, you wrote:
>Hi,
>
>But the result is not the same for CHAR and VARCHAR fields.
>It returns records for the VarChar and none for the char.
>
>But this means that trying a LIKE '%...' on a char field only returns
>records for those fields that are full filled.
>In my opinion this is almost useless.

Of course it is useless when applied to a CHAR type that does not use all of the available character places. When you have to store variable length data, viz., any data that is allowed to be shorter than the defined length, then VARCHAR is the only one that makes any design sense.

>End users don't understand those technical details, and if they query for
>some field that ends with some text, they don't expect this kind of result.

Also exactly correct. Data should behave the way ordinary humans expect it to behave. It's your job to design the database to meet that requirement. Defining CHAR for data of variable length does not meet that requirement.

./heLen