Re: Why not varchar2 = 2000?
Date: 31 Jan 1995 07:12:44 GMT
Message-ID: <3gkntc$a3g_at_dcsun4.us.oracle.com>
In article <1995Jan25.160129.1_at_cbr.hhcs.gov.au>, morleb_at_cbr.hhcs.gov.au writes:
|> In article <3fa5gh$4rf_at_portal.gmu.edu>, dnguyeb_at_site.gmu.edu (Dong Duong Nguyen (CS 571)) writes:
|> > Hello,
|> > Can anyone tell me why a varchar2 field should not be defined to be
|> > a maximum of 2000 bytes. ORACLE will only store what is used anyway.
|> > So, why not define it to be a maximum.
|> >
|>
|> There is slight storage penalty for using VARCHAR2 columns larger than
|> 255 because 3 bytes must be used to record the length of the stored
|> string instead of the usual 1 byte. Once you exceed 255, there is no
|> penalty in going the whole hog and specifying 2000 (See Oracle 7
|> Server Administrator's Guide Chapter 8).
|> ----------------------------------------------------------------------
|> Brian Morley morleb_at_cbr.hhcs.gov.au
|> Dept Human Service & Health, Brisbane, Australia
Also, if all of your varchar2 columns are 2000, you lose any method of dynamicly allocating less space in a Pro*C program. And if you select from the table in SQL*Plus, you will not get nice output since it will leave space for 2000 characters each field. I wouldn't recommend it. Received on Tue Jan 31 1995 - 08:12:44 CET