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 -> Using CHAR instead of VARCHAR2 for small fields

Using CHAR instead of VARCHAR2 for small fields

From: Michael E. Moores <moores_at_digitech.net>
Date: 1997/09/04
Message-ID: <873396449.26153@dejanews.com>#1/1

I have been designing Oracle tables, using CHAR data type for fields that contain a small domain, rather than using VARCHAR2.
An example would be a field "STATUS CHAR(8)", and it's legal values are
{'NEW','OPENED','ASSIGNED','COMPLETE','QA'}. I also used a CHAR(2) for a postal state code, which can only contain exactly two characters.

I used the CHAR type becuase it seemed impractical to use a variable length string (VARCHAR2) to store this type. I'm not concerned about space usage, and it seems the updates will be faster on a fixed size field.

However, when i look at some Oracle views, I see fields of type VARCHAR(1), VARCHAR2(2).

Any advise on this matter??

--Michael

-------------------==== Posted via Deja News ====-----------------------
      http://www.dejanews.com/     Search, Read, Post to Usenet
Received on Thu Sep 04 1997 - 00:00:00 CDT

Original text of this message

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