Subject RE: [firebird-support] Is this a bug? (FB 2.1 <...> 2.1.2)
Author Luis Madaleno - m@gnisoftR
I usually use CHAR() for short length fields (like the one in this example,
char(5)), and VARCHAR() for greater ones, like VARCHAR(50), VARCHAR(255),
etc...

In fact I don't know the reason why I choose that.
But now it seems that I should use only VARCHAR() since CHAR() has no
advantages.


Regards,

Luis Madaleno


-----Mensagem original-----
De: firebird-support@yahoogroups.com
[mailto:firebird-support@yahoogroups.com] Em nome de Dimitry Sibiryakov
Enviada: segunda-feira, 27 de Abril de 2009 10:57
Para: firebird-support@yahoogroups.com
Assunto: Re: [firebird-support] Is this a bug? (FB 2.1 <...> 2.1.2)

> ? Alright fixed length character fields may be a bit long in the tooth,
> but they do still have a place. Yes they can be defined as varchar, but
> that hides the fact that they are always full length, and I would expect
> them to be packed to full length when output?

I don't know what "output" you have in mind, but on disk CHAR and
VARCHAR are stored the same way - in full length, RLE compressed.
The topic starter obviously need VARCHAR, because he wants to look
for string by it's last character ('A') and ignores the fact, that
"half-filled" CHARs have space at it's last character. That's OK, I also
was ignorant years ago and chose CHARs without strong reason.

SY, SD.


------------------------------------

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Visit http://www.firebirdsql.org and click the Resources item
on the main (top) menu. Try Knowledgebase and FAQ links !

Also search the knowledgebases at http://www.ibphoenix.com

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Yahoo! Groups Links