Subject Re: [firebird-support] Select on varchar with spaces
Author Daniel Rail
Hi,

At June 27, 2005, 09:18, Kjell Rilbe wrote:

> Daniel Rail wrote:
>> SQL Standard, for quite a number of years(maybe over 10-15 years). The
>> trailing blanks in a VARCHAR are stripped when using the "="
>> comparison.

> Is that supposed to be some kind of backwards compatibility feature
> between varchar and char? (Wasn't varchar introduced later than char?)

VARCHAR is the same as CHARACTER VARYING. And, CHAR(or CHARACTER) is a
fixed length string, and uses its full length of characters for
comparisons, including trailing blanks. And, VARCHAR is a string of
variable length and the trailing blanks are not used for comparisons.

But, the keyword VARCHAR was introduced in SQL-92(official in 1992 to
be more precise). So, it's possible that it was used before that date,
since it would've been submitted to the standards committee for
discussion a few years before.

--
Best regards,
Daniel Rail
Senior Software Developer
ACCRA Consultants Inc. (www.accra.ca)
ACCRA Med Software Inc. (www.filopto.com)