Unix Technical Forum

Does varchar2 size matter?

This is a discussion on Does varchar2 size matter? within the Oracle Miscellaneous forums, part of the Oracle Database category; --> What are the repercussions of declaring all strings varchar2(255) even if many will have lengths <=20 or <=30 (but ...


Go Back   Unix Technical Forum > Database Server Software > Oracle Database > Oracle Miscellaneous

Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-08-2008, 06:54 AM
tedb@nc.rr.com
 
Posts: n/a
Default Does varchar2 size matter?

What are the repercussions of declaring all strings varchar2(255) even
if many will have lengths <=20 or <=30 (but none >255)?

Is there any value declaring some to be varchar2(20) or varchar2(30)
rather than just making them all varchar2(255)?

I'm converting a MySQL database to Oracle. By default MySQL accepts
strings too long and overwrites memory, which is okay as long as the
memory is unusued, but becomes a problem when it overwrites used
memory.

Thanks,
Ted Bogart

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 04-08-2008, 06:54 AM
DA Morgan
 
Posts: n/a
Default Re: Does varchar2 size matter?

tedb@nc.rr.com wrote:
> What are the repercussions of declaring all strings varchar2(255) even
> if many will have lengths <=20 or <=30 (but none >255)?
>
> Is there any value declaring some to be varchar2(20) or varchar2(30)
> rather than just making them all varchar2(255)?
>
> I'm converting a MySQL database to Oracle. By default MySQL accepts
> strings too long and overwrites memory, which is okay as long as the
> memory is unusued, but becomes a problem when it overwrites used
> memory.
>
> Thanks,
> Ted Bogart


In terms of storage none. In terms of data integrity: Huge.
--
Daniel A. Morgan
http://www.psoug.org
damorgan@x.washington.edu
(replace x with u to respond)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 04-08-2008, 06:54 AM
HansF
 
Posts: n/a
Default Re: Does varchar2 size matter?

On Thu, 02 Jun 2005 16:35:36 -0700, tedb interested us by writing:

> What are the repercussions of declaring all strings varchar2(255) even
> if many will have lengths <=20 or <=30 (but none >255)?
>
> Is there any value declaring some to be varchar2(20) or varchar2(30)
> rather than just making them all varchar2(255)?
>
> I'm converting a MySQL database to Oracle. By default MySQL accepts
> strings too long and overwrites memory, which is okay as long as the
> memory is unusued, but becomes a problem when it overwrites used
> memory.
>
> Thanks,
> Ted Bogart


Depends on your application. Generally no impact on the database.

Can your app handle freestyle ranges from 0-255 bytes? Does it really
make sense? DO you want to rely on your app developers to make the
correct decision ALL the time or do you want to put an added integrity
check at the one-and-only place that you are guaranteed to hit. (Meaning,
users have a habit of bypassing apps using Access, Excel, etc. and royally
messing data that isn't protected by constraints.)

--
Hans Forbrich
Canada-wide Oracle training and consulting
mailto: Fuzzy.GreyBeard_at_gmail.com
*** I no longer assist with top-posted newsgroup queries ***
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 04-08-2008, 06:54 AM
tedb@nc.rr.com
 
Posts: n/a
Default Re: Does varchar2 size matter?


> What are the repercussions of declaring all strings varchar2(255) even
> if many will have lengths <=20 or <=30 (but none >255)?
>
> Is there any value declaring some to be varchar2(20) or varchar2(30)
> rather than just making them all varchar2(255)?
>
> I'm converting a MySQL database to Oracle. By default MySQL accepts
> strings too long and overwrites memory, which is okay as long as the
> memory is unusued, but becomes a problem when it overwrites used
> memory.
>
> Thanks,
> Ted Bogart


Thanks for the help. I was mainly worried about storage and
performance. The data is mainly "generic" and used in unbounded Java
Strings. Data integrity is already comprised since we're currently
using MySQL which is silently ignoring size errors and either
truncating or overwriting the data, with future consequences.

Per the advice given, I'll review the application for data integrity
issues.

Thanks for your timely help. It's very much appreciated and will make
my day so much better tomorrow!!!!

Thanks,
Ted Bogart

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 08:56 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0
www.UnixAdminTalk.com