Re: VARCHAR2 vs. CHAR

From: N Prabhakar <N_Prabhakar_at_Socgen-Crosby.com>
Date: 1996/11/22
Message-ID: <572sh3$21e_at_newton.pacific.net.sg>#1/1


Yudong Sun <ysun_at_econnect.ca> writes: > How efficient is VARCHAR2's implementation?
> Would I have a reason to prefer the use of CHAR for things like
> a person name (e.g., CHAR(50))? (I would use VARCHAR2 for things
> like file path - e.g. VARCHAR2(256).)
>
> Thanks a lot,
>
> Yudong

Hi there,

In your example, if you use CHAR datatpe for person name, then Oracle will store 50 bytes for each column (irrespective of person name is 50 characters or 5 characters). This will result in lot of unnecessary space. CHAR datatype is a fixed length datatype.

If you are storing a column ('Y' or 'N') or any thing that will occupy fixed length, then it does not matter whether you use CHAR or VARCHAR2 datatype.

Definately, VARCHAR2 datatype helps in storing long fields.

Regards

N.Prabhakar Received on Fri Nov 22 1996 - 00:00:00 CET

Original text of this message