| Oracle FAQ | Your Portal to the Oracle Knowledge Grid | |
Home -> Community -> Usenet -> c.d.o.misc -> Re: [Q] Varchar = Char?
replace this with @ Martin Jesterhoudt wrote:
>
> Hi,
>
> I've heart that a Char is also written in variable length to the
> database. In that case, it doesn't differ from Varchar. So what's the
> difference? Maybe for compatibility reasons?
> -------------------------------------------------------------------------------
> --- Martin Jesterhoudt
> --- martinj(replace this by @)xs4all.nl
> -------------------------------------------------------------------------------
Hi Martin,
CHAR columns may be from 1 to 255 characters long and the CHAR values are always padded with blanks to the specified length, whereas VARCHAR values can be up to 2000 characters long and are not padded. Oracle recommends to use VARCHAR2 instead of VARCHAR since the meaning of VARCHAR can change in future time.
Let's look at 'Martin':
CHAR(10): 'Martin '
VARCHAR2(10): 'Martin'
-- Regards Matthias Gresz :-)Received on Wed Dec 17 1997 - 00:00:00 CST
![]() |
![]() |