Re: CHAR vs VARCHAR2

From: Tim Fitzpatrick <timf_at_eircom.ie>
Date: Sun, 11 Feb 2001 15:36:44 GMT
Message-ID: <gkyh6.9088$r17.28548_at_news.iol.ie>


The CHAR datatype stores one byte per character, but always uses the maximum length specified, space padded.

The VARCHAR2 datatype stores one byte to hold the length of the character string plus one byte per character, no padding (i.e. variable length).

Thus VARCHAR2 saves space unless the string is only one byte long (e.g. a Y/N flag). Oracle don't promise to support CHAR in future implementations of the RDBMS (mind you, they've said that since Oracle 6).

Anyone with any experience in Oracle development and database design is unlikely to use CHAR (except maybe in the example given above). It's certainly been the case in the companies I've worked for.

I hope this helps.

Cheers,

Tim

"Lee Miller" <diamon_at_newsguy.com> wrote in message news:95pctc02j99_at_enews4.newsguy.com...
> Does anyone have a good link to the caveats of using VARCHAR2 in
 place of
> CHAR, and what general guidelines there are for when you should use
 which.
>
>
Received on Sun Feb 11 2001 - 16:36:44 CET

Original text of this message