Subject | Re: [firebird-support] Dear friends - Varchar size |
---|---|
Author | Martijn Tonies |
Post date | 2005-11-01T16:17:39Z |
> >>If you define a field as varchar(10) the maximum allowed will be 10Yes.
> >>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.
> >
> Are you sure ?
> I've never used a multi-byte charset, but I think FB always treat lengthNo.
> in bytes not chars.
> Maybe I have messed the things up with the length function that countCould be. In the system tables, there are two columns, one for byte-length
> bytes instead of chars...
and one for character-length. If you use a multi-byte characterset,
byte-length
will be longer than character-length.
> Well, let's see if anyone come with something to clear my mind. Or whenWith regards,
> I have time will try to create a multi-byte database and test it myself.
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