Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: [OT] Index on Number & Varchar2
> [...]
> 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