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: [OT] Index on Number & Varchar2

Re: [OT] Index on Number & Varchar2

From: Hilarion <m0rt_at_wytnij.poczta.onet.pl>
Date: Tue, 2 Dec 2003 20:12:17 +0100
Message-ID: <bqioce$b57$1@news.onet.pl>


> [...]
> varchar2(10) takes 10 bytes, assuming all
> positions are used.
>
> Varchar2(20) only takes 10 bytes if it's only storing 10 characters.
> [...]

Hmm... If we have VARCHAR2(20) storing 10 chars, then how can you store it on 10 bytes? Where from you take the information about string length, or string ending?
I do not know where from I know it, so I can be wrong, but I think that a 10 char string takes 11 bytes (10 chars + 1 byte string ending mark). If it's not so, then what is the CHAR type for? (String stored in CHAR column has always as many chars as defined, so it does not have to use string ending mark.)
Please correct me if I'm wrong.

Hilarion Received on Tue Dec 02 2003 - 13:12:17 CST

Original text of this message

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