Re: Column space requirements - VARCHAR2 versus NUMBER

From: Rockhound57 <Rockhound57_at_NSA.com>
Date: Tue, 10 May 2011 11:37:24 -0400
Message-ID: <9omis6d4vos7hi8e2844shm66fc2nie4g1_at_4ax.com>



On Mon, 09 May 2011 16:01:16 -0400, Walt <walt_askier_at_yahoo.com> wrote:

>On 5/8/2011 11:08 PM, Rockhound57 wrote:
>
>>
>> Leading zeros... Think everyone haves them.
>Rockhound,
>
>Did you meant to say "everyone *hates* them"? If so, I'm in complete
>agreement.

Exactly. as usual, I can't type worth spit. :)

>
>Luke,
>
>Unless you are working with legacy data where (for instance) you need
>to distinguish between 42 042 and 000042, everything will work much
>much better if you just use the Number datatype. Numeric-like data with
>leading zeroes is a notorious bug-inducer - in particular, M$ Excel has
>fits whenever it encounters numeric-like data with leading zeroes.
>

Modeling here is key. Wish we had a clue as to what this column data was representing, the advice would be better. If it's some sort of part number, where the zeros are a part of the identifier, they're something that has to be kept. But, not knowing what the information in the table IS, it's hard to be truly helpful.

As I often say, the "DBA Ouija board" is down for maintenance today.

:)

>If you can design them out of the spec now, you will save yourself and
>your colleagues many many frustrating hours of coding around the leading
>zeroes.
>
>There are space and speed advantages of going with the Number datatype
>as well, but they pale in comparison to the frustration you'll encounter
>when the system *breaks* rather than just being slow or taking up a lot
>of space.
>
>//Walt
Received on Tue May 10 2011 - 10:37:24 CDT

Original text of this message