Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.tools -> Re: char vs varchar2

Re: char vs varchar2

From: Mark D Powell <markp7832_at_my-deja.com>
Date: 2000/06/30
Message-ID: <8ji7rc$6u2$1@nnrp1.deja.com>#1/1

In article <1kZ65.2367$Dr3.145406_at_monolith.news.easynet.net>,   "gi" <gi_at_england.com> wrote:
> Can someone tell me ...but who really knows
> if I have filled with length is there any difference if I use char(1)
 or
> varchar2(1)
> I read somewhere that char is there only because COBOL programs but
 I'm not
> sure is that true
> Thanks
>

In general you should probably use varchar2(n) in preference to char (n). In the case of varchar2(1) vs char(1) [the default] then there is one byte per column of less overhead when using char. Varchar2 saves space by not storing trailing blanks which can result in more rows per block being stored and hence less I/O to retrieve the rows. It also helps elimanates mismatches caused by comparing columns with the same first x characters but a different number of trailing characters.

--
Mark D. Powell  -- The only advice that counts is the advice that
 you follow so follow your own advice --


Sent via Deja.com http://www.deja.com/
Before you buy.
Received on Fri Jun 30 2000 - 00:00:00 CDT

Original text of this message

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