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

Home -> Community -> Usenet -> c.d.o.server -> Re: VARCHAR2(1) vs CHAR(1)

Re: VARCHAR2(1) vs CHAR(1)

From: Richard Foote <richard.foote_at_bigpond.com>
Date: Tue, 30 Jul 2002 09:56:47 +1000
Message-ID: <Gvk19.47019$Hj3.142967@newsfeeds.bigpond.com>


Hi Marco,

If you take a squiz at the Concepts Manual, the chapter that discusses Schema objects has a discussion of the format of a row,

Young Conner (so he tells me) is absolutely correct in saying that Oracle stores Char and Varchar2 in the same way (column length followed by column value). The reason being that as Oracle ploughs through a row taking out data of interest, it requires the length portion of the column to determine how much to read (else it would require access to the DD to determine it's length, I don't think so).

Cheers

Richard

"Marco Muracchioli" <reply.on_at_group.please> wrote in message news:zpi19.155593$vm5.5228782_at_news2.tin.it...
> From Oracle8 complete reference:
>
> CHAR(size) Fixed-length character data, "size" character long.
Maximum
> size
> is 2000. Default 1 byte. Padded on the right with blanks
to
> full
> length of size.
> VARCHAR2(size) Variable length character string having a maximum of
"size"
> bytes
> (up to 4000).
> VARCHAR(size) Same as varchar2. Use varchar2, since varchar's usage may
> change
> in future version of Oracle.
>
> This is my reference. Where you find that data are stored in the same way
> (size then data and not only data for char)?
> This is not polemic, just a new information for me too.
>
> Thanks,
> Marco
>
> > You'll find that char(n) and varchar2(n) are implemented (ie stored) in
> > exactly the same way, ie, length and data are stored. The argument
> > between them is if you want the data padded out with spaces (which I
> > would say is rare unless you have a requirement for fixed length rows to
> > improve storage management)
>
>
Received on Mon Jul 29 2002 - 18:56:47 CDT

Original text of this message

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