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

Home -> Community -> Usenet -> c.d.o.misc -> Re: varchar(2) use

Re: varchar(2) use

From: Thomas Kyte <tkyte_at_us.oracle.com>
Date: 1997/05/27
Message-ID: <338d3b42.2972354@newshost>#1/1

In Oracle, a char is a varchar that is blank padded to a maximum length. A char has the same leading byte(s) length field a varchar2 does.

a char(5) will always take either 0, 1 or 6 bytes,

a varchar2(5) will take somewhere between 0 and 6 bytes depending on the data.

In the case of a varchar2(1) and a char(1), it would really be 6 one way, 1/2 dozen the other... they will be the same.

On 23 May 1997 18:15:52 GMT, "BSD" <bsdone_at_enterprise.net> wrote:

>You would not normally use varchar for field which have length lesser than
>say 5.This is because varchar uses one byte for storage of the length of
>the
>actual data stored within the field.
>
>Normally varchars would be used for fields greater than 5 and never user
>varchar
>for a field which is a single byte in length.
>
>Regards
>Sanjay Mathew
>sanjay.mathew_at_burton.co.uk
>
>
>
>YogitaT <yogitat_at_aol.com> wrote in article
><19970516231000.TAA00690_at_ladder02.news.aol.com>...
>> can we use varchar2 if it is varchar2(1) and 100 or more such columns in
>> our table instead of char(1) . Actually I want to know overhead defining
>> column as varchar instead of char which is fixed.
>> thanks
>>

Thomas Kyte
tkyte_at_us.oracle.com
Oracle Government
Bethesda MD

http://govt.us.oracle.com/ -- downloadable utilities



Opinions are mine and do not necessarily reflect those of Oracle Corporation Received on Tue May 27 1997 - 00:00:00 CDT

Original text of this message

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