Re: Help: VARCHAR2

From: EndUser <enduser_at_enduser.com>
Date: 1995/11/13
Message-ID: <enduser-1311952048300001_at_dial-cup1-10.iway.aimnet.com>#1/1


varchar(1) makes no sense, anything larger does.

char(2) gives you a space pad, much code would break if it did not expect this, or allow for a 0-2 sized data in such a field. also, char(2) wastes 1 byte in such a circumstance, trade that off with a varchar(2) which wastes the same amount. the increased wasted occurs above that.

if you say a char(2) field will always have 2 chars of data, then it is appropriate, in other words, use char when the length is 1, when the performance is important and the column is in a key, and when the data is truly fixed size, always filling the space allocated.

--

In article <30A7B1FB.778C_at_ncr.disa.mil>, Michael A McKenney
<mckennem_at_ncr.disa.mil> wrote:


> But what about relatively small fields? Such as 1-8 characters. I
understand
> the issue on a 2000 character field. But a varchar2(1) or even a
varchar2(20)
> doesn't make sense to me in terms of i/o vs space tradeoff.
Received on Mon Nov 13 1995 - 00:00:00 CET

Original text of this message