Re: VARCHAR2

From: Vince Germscheid <vince_germscheid_at_cscmail.csc.com>
Date: 1996/07/26
Message-ID: <4tbicd$gag_at_explorer.csc.com>#1/1


Gregory R Mattes <mattes+_at_andrew.cmu.edu> writes:
> let me begin by saying that i'm a relative novice, if anyone can point
> me to the FAQ for this group (if one exists) i'd be very grateful.
>
> I have a question concerning the VARCHAR2 datatype. i have a
> reference book that tells me that there is no penalty for declaring a
> large maximum value for a VARCHAR2 and storing a relatively small string
> in it. it says that the largest length of a VARCHAR2 is 2000
> characters. my question is this: why not simply declare all string
> columns as VARCHAR2( 2000 ) ??
>
> is this in fact the popular way to do things? if not, why? is there
> a speed hit incurred in searches involving VARCHAR2's as compared with
> fixed width CHAR's? why do fixed with CHAR's exist if there is no
> penalty for using VARCHAR2's?
>
>

It's not simply a matter of 'can this be done', because it can, but rather one of should it be done. Oracle only stores the amount of text stored in a VARCHAR type. However from a strict data modelling standpoint, the length of an attribute (column) is, or should be, constrained by the definition of that attribute. There is no valid reason to define the column such that data can be entered into the column which violates its very definition.

In addition, model based tools such as Uniface depend on the data definitions in construction of visual objects, and the defined length of the column has an effect on the functional characteristics of the entry field for that column.

Vince. Received on Fri Jul 26 1996 - 00:00:00 CEST

Original text of this message