Subject Re: [firebird-support] Dear friends - Varchar size
Author Martijn Tonies
Alexandre,

> >Please, could anybody answer?
> >
> >Is it necessary to define a maximum size for the field varchar?
> >If I create a field varchar(10) cannot I insert more than ten characters?
> >
> >Thanks
> >
> >Marcelo
> >
> >
> >
> Marcelo,
>
> If you define a field as varchar(10) the maximum allowed will be 10
> characters, if you use multi-byte character sets than the value will be
> small. FB 1.5 count the field size in bytes since multi-bytes uses more
> than 1 byte then less characters could be stores in a 10 bytes field.
>
> Read varchar(10) as "up to" 10 chars.

This is not true. varchar(10) always means a max of 10 characters,
despite what characterset you're using.

With regards,

Martijn Tonies
Database Workbench - tool for InterBase, Firebird, MySQL, Oracle & MS SQL
Server
Upscene Productions
http://www.upscene.com
Database development questions? Check the forum!
http://www.databasedevelopmentforum.com