Subject | RE: [ib-support] Firebird VARCHAR size |
---|---|
Author | Thomas Steinmaurer |
Post date | 2003-03-11T07:49:35Z |
> >if you have a one byte collation then it probably should beThe InterBase quote is talking about characters in general, but
> >32765 for VARCHAR due to the extra two bytes holding the
> >VARCHAR length information. It's 32767 for a CHAR.
>
> Just so, Thomas! Apols to Robert di Falco for not checking the InterBase
> quote for correctness.
not specific to the VARCHAR data type, so it's hard to say, that
it is wrong (IMHO). ;-)
> I think possibly it is 32766 for varchar (32Kb minus 2). Char uses 1 byteNo. The maximal length for the CHAR datatype *is* 32767 minus 2 bytes
> to store length.
for VARCHAR, thus 32765.
This works:
alter table mytable add bigvarchar varchar(32765)
alter table mytable add bigchar char(32767)
Whereas this doesn't:
alter table mytable add bigvarchar varchar(32766)
alter table mytable add bigchar char(32768)
Regards,
Thomas.