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: Stephane Faroult <sfaroult_at_oriole.com>
Date: Sat, 13 Jan 2001 17:15:42 +0100
Message-Id: <10740.126619@fatcity.com>


You're absolutely right. Oracle always store the length information before the column. I guess I have written too much Pro*C code in my wild days ...

Regards,

Stéphane Faroult
Oriole Corporation

Roby Sherman wrote:

> 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.
>
> --Roby
>
>
>
> --
> Please see the official ORACLE-L FAQ: http://www.orafaq.com
> --
> Author: Roby Sherman
Received on Sat Jan 13 2001 - 10:15:42 CST

Original text of this message

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