This may depend on the specific database you're using, but in my experience, it means the number of bytes, not the number of characters. Which means it can be difficult to know in advance whether a given string is too long for a field, if the characters are not ASCII chars. If necessary, you can convert a String to a byte (using the appropriate encoding) and measure its length, to find out if it's too big for a VARCHAR field. You should check the documentation for the specific database you're using to be sure. [ May 29, 2007: Message edited by: Jim Yingst ]
"I'm not back." - Bill Harding, Twister
Joined: Nov 29, 2005
I too think it should be like that way.
But its very confusing when the character set of the database is something like UTF-8 (multibyte) and we define the column type as varchar(4) , which means it can store 4 characters.(can be any number of bytes in case of UTF-8).
Might be the databases that support UTF-8 as encoding doesnot allocate bytes for columns initially and might have data structure for accommodating variable chunks of bytes.