Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Using CHAR instead of VARCHAR2 for small fields
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 UsenetReceived on Thu Sep 04 1997 - 00:00:00 CDT