Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: CHAR vs VARCHAR
Mark D Powell (Mark.Powell_at_eds.com) wrote:
: "Jérôme VUIBERT" <jerome.vuibert_at_fleximage.fr> wrote in message news:<3e8a915b$0$30756$626a54ce_at_news.free.fr>...
: > With CHAR(4) the data will be recorded using exactly 4 caracters.
: > With VARCHAR(4) the date will be recorded up to 4 caracters.
: > So if you are sure that the data to be stored is exactly 4 caracters long,
: > then use CHAR(4). The record will be optimized.
: >
: > Jerome
: >
: > "Paul Pruchnik" <paulrp_at_earthlink.net> a écrit dans le message de news:
: > 5eria.3978$ey1.309583_at_newsread1.prod.itd.earthlink.net...
: > > Greetings,
: > > What is the savings of CHAR(4) vs VARCHAR(4) for storing a 4 (required)
: > > character code? What is the overhead in using VARCHAR for fields of
: > required
: > > length?
: > > Thanks,
: > > -Paul Pruchnik
: > >
: It is my observation that most 'experts' seem to recommend the use of
: varchar2 over char, and from the few views I have had of modern
: application code from Oracle it appears Oracle development is using
: varchar2 over char even for varchar2(1) vs char.
(Ironicly) I read (some years ago now) that because varchar2 is not standard sql, oracle will guarantee that the meaning and use of it will never change.
CHAR on the other hand is part of the SQL standard, and such standards do in fact change from time to time. If the standard "clarifies" or enhances the behaviour of CHAR then oracle will have to modify the meaning of CHAR to suit. Received on Wed Apr 02 2003 - 17:08:58 CST
![]() |
![]() |