Re: varchar2(size)

From: gazzag <gareth_at_jamms.org>
Date: Thu, 1 Oct 2009 05:36:07 -0700 (PDT)
Message-ID: <3ca21a1a-b397-4efd-a4c1-23aacc8f5c88_at_k17g2000yqb.googlegroups.com>



On 30 Sep, 20:19, yf..._at_vtn1.victoria.tc.ca (Malcolm Dew-Jones) wrote:
> John Hurley (johnbhur..._at_sbcglobal.net) wrote:
>
> : On Sep 29, 7:46=A0pm, indytoatl <indyto..._at_gmail.com> wrote:
>
> : snip
>
> : > If I have a table with 200 fields that are all variable length what
> : > would be the drawback be of making them all varchar2(100) so that I
> : > don't have to guess a number for each field. The form users fill out
> : > already has contraints for the same fields (ie, Last Name Field on
> : > form has 20 space limit.).
>
> : Why don't you just make them all 2000 characters apiece since 100
> : might be too small?
>
> : Most properly designed database tables do not have 200 columns in
> : them.
>
> : If the maximum size of a last name is 20 spaces ... why would you not
> : use varchar2(20)?
>
> What if you need to save Mr. Seamus Wolfeschlegelsteinhausenbergerdorff's name in
> your database?  What if his daughter then gets married and hyphenates her name with
> her husband's?
>
> Many "maximum" sizes are really just arbitrary guesses.

Connected to:
Oracle Database 10g Release 10.2.0.4.0 - 64bit Production

SQL> create table test_tab (
  2 col1 varchar2(20));

Table created.

SQL> desc test_tab;

 Name                                      Null?    Type
 ----------------------------------------- --------
----------------------------
 COL1                                               VARCHAR2(20)

SQL> alter table test_tab modify ( col1 varchar2(50) );

Table altered.

SQL> desc test_tab;

 Name                                      Null?    Type
 ----------------------------------------- --------
----------------------------
 COL1                                               VARCHAR2(50)

:)

HTH -g Received on Thu Oct 01 2009 - 07:36:07 CDT

Original text of this message