Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Mailing Lists -> Oracle-L -> Re: Just Define VARCHAR2 with Length of 2000 -Reply
>
I'm not sure about this. The old limit of 255 was based on using 1 byte to store the length of a column entry. In order to store a length of 2000 you need 13 bits which won't fit into a single byte. If you declare a column varchar2(2000). I believe two bytes are automatically allocated to store the length.
Another reason to not go to 2000 character varchar2's is applications programming. Default display lengths are based on a column's definition in the database. Yes you can control this in these programs, but it means more work.
Finally a column definition of varchar2(2000) of what is in reality a "short" field invites people to cram two or more values into a single instance of the field. Not all fields can be protected via constraints nor triggers.
I'd reconsider useing varchar2(2000) for all your fields.
Ian MacGregor
Stanford Linear Accelerator Center
ian_at_slac.stanford.edu
Received on Tue Feb 06 1996 - 16:06:09 CST
![]() |
![]() |