Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Mailing Lists -> Oracle-L -> Re: VARCHAR2(1) vs VARCHAR(2)

Re: VARCHAR2(1) vs VARCHAR(2)

From: Roby Sherman <rxsherm_at_interealm.com>
Date: Sat, 13 Jan 2001 08:00:44 -0700
Message-Id: <10740.126618@fatcity.com>


Stephane Faroult wrote:

> Wayne,
>
>
>
> AFAIK 'Oracle works better' with 2-char columns is a total fallacy. What is a
>
> varchar() ? Basically one (or three, depending on the first byte value) byte to give
>
> a length, followed by the actual string. The length of the actual string is totally
>
> irrelevant - well, I'd tend to favour strings under 255 chars over those over this
>
> limit but it's about all ... unless you want to get down to the word size on your
>
> machine but that would be hair-splitting, wouldn't it.
>
> Personally, I tend to use CHAR(1), not VARCHAR(1) - don't see the point in using two
>
> bytes where one is enough.

Actually, if you take a block dump of row data with a varchar2(1), a varchar(1), and a char(1), you'll notice that all three column types use the same amount of bytes. The first byte is still used for length (yes, even in the fixed length chars), and the other byte is the character itself. Received on Sat Jan 13 2001 - 09:00:44 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US