Re: varchar2(size)

From: Shakespeare <whatsin_at_xs4all.nl>
Date: Thu, 01 Oct 2009 21:27:07 +0200
Message-ID: <4ac50290$0$83251$e4fe514c_at_news.xs4all.nl>



gazzag schreef:
> 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

And recompile all references.

Shakespeare Received on Thu Oct 01 2009 - 14:27:07 CDT

Original text of this message