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: CHAR vs VARCHAR

Re: CHAR vs VARCHAR

From: Andrew Allen <andrew.allen_at_sppaammkiller.handleman.com>
Date: Wed, 02 Apr 2003 16:45:14 GMT
Message-ID: <3E8B069C.2080201@sppaammkiller.handleman.com>

Chaz wrote:
> "Paul Pruchnik" <paulrp_at_earthlink.net> wrote in message
> news:5eria.3978$ey1.309583_at_newsread1.prod.itd.earthlink.net...
>

>>Greetings,
>>What is the savings of CHAR(4) vs VARCHAR(4) for storing a 4 (required)
>>character code? What is the overhead in using VARCHAR for fields of

>
> required
>
>>length?
>>Thanks,
>>-Paul Pruchnik
>>
>>

>
>
> Where X is the field length, and N is the length of data,
>
> CHAR uses X
> VARCHAR uses N+1
>
> Please read the manual, that's what it's there for!
Except that CHAR still requires a 1-byte flag to indicate null so the space requierd is still N+1. Use VARCHAR2, CHAR will not save you anything and WILL end up causing you grief some day.
--
AJ Allen
Received on Wed Apr 02 2003 - 10:45:14 CST

Original text of this message

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