Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: Is the use of VARCHAR(256) as Primary Keys preferred in Oracle?

Re: Is the use of VARCHAR(256) as Primary Keys preferred in Oracle?

From: Karsten Farrell <kfarrell_at_belgariad.com>
Date: Tue, 19 Nov 2002 17:13:16 GMT
Message-ID: <MiuC9.605$_V1.62559417@newssvr14.news.prodigy.com>


Peter J. Holzer wrote:
> On 2002-11-18 22:57, Karsten Farrell <kfarrell_at_belgariad.com> wrote:
>

>>When I started with my company, there was a widespread belief among the 
>>developers that Oracle stored any column smaller than VARCHAR2(2048) as 

>
> [...]
>
>>We have so many 2048-byte columns in our database because of this
>>belief ... but I've since shrunk most of them

>
>
> Why did you shrink them? A varchar2(2048) doesn't take up more space
> that a varchar2(176). If I could, I would declare all character columns
> as varchar(infinity), and stop worrying how long the data can actually
> become.
>
> hp
>

True, Oracle is very efficient in storing them. But when you go to display them, say in Oracle Reports or a SQL Plus report, you have to wrap or something ... because sure enuf, some person will insert the complete works of Shakespeare in your big column if you allow for it. Since most of our VARCHAR2 fields are displayed in web forms, I don't worry about the size of any columns that won't ever appear on a report (can I say "won't ever"?).

/Karsten Received on Tue Nov 19 2002 - 11:13:16 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US