Subject Re: [ib-support] VARCHAR size
Author Nando Dessena

R> Is there a reason not to simply specify all VARCHARs to use the max size
R> in Firebird?

one compelling reason would be that they travel in full-length between
server and client. :-(

R> Since VARCHARs by definition only use as much space as
R> necessary to store a string (the length of which is stored in the first
R> two bytes), why does VARCHAR even take a length parameter?

maximum length is a domain attribute before it is an implementation
constraint. You want to specify that a certain data item has a maximum
length of x, just to express a business rule.

Furthermore, you also want to know what this maximum length is in your
code, for declaring static buffers, etc. Having a piece of code cater for 32K when
it really can't receive more than 16 bytes can be wasteful and
deceiving, IMHO.

Nando mailto:nandod@...