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/17
Message-ID: <337dfabf.897099@newshost>#1/1

On 16 May 1997 19:10:49 GMT, yogitat_at_aol.com (YogitaT) wrote:

>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

A char is a varchar that is blank padded to a maximum length.

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.

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 Sat May 17 1997 - 00:00:00 CDT

Original text of this message

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