Subject Re: [firebird-support] RE: Welcome to firebird-support
Author Helen Borrie
At 02:47 PM 15/10/2004 +1000, you wrote:


>Hi,
>
>For the purpose of storage what is the most efficient way to define a column
>in a DB which can hold non-numerical values. i.e. Char or VarChar provided
>we choose the same size?

Use CHAR() when the column has to be exactly that size - usually some kind
of serial coding like an ABN, a barcode value, a Medicare number, a hex code.

Use VARCHAR() for everything else.

Char() stores as exactly the defined length, regardless of the size of
actual stored data. Varchar() stores only the actual data, + 2 bytes
storing its length.

Varchar() is faster across the wire in Fb 1.5, since there is no
padding. (Varchars are right-padded in Fb 1.0). Char() is both stored and
transported right-padded with asc(32) characters.

./heLen