Re: Help about a data type

From: Alan <alanshein_at_spambuster.erols.com>
Date: Fri, 17 Nov 2000 10:44:41 -0500
Message-ID: <8v3joo$l46$1_at_bob.news.rcn.net>


Generally, if you are not doing calculations, you should use a string data type. For example, with zip codes, if you enter

08765

in a number type, only the
8765 is stored

where as in a string type, it will storeas

08765.

Some RDBMSes support a minimum storage string type such as Oracle's VARCHAR2. So, if you define a field such as

postal_code VARCHAR2(20)

you are good for anything up to 20 characters, but 20 characters are not used for every record. A zip code would only occupy 6 characters worth of space on the disk, not 20. A number type, would always occupy the full size allocated to that type, plus you lose the flexibility of storing other characters.

<acatala_at_llacerynavarro.com> wrote in message news:3A14FB1D.DD882010_at_llacerynavarro.com...
> Hi:
>
> What data type is better for a field that will contain a number from a
> arithmetic operetion never will be made (like product code, telephone
> number, etc) ?
>
> Is it better numeric, alphanumeric or is it the same ?
>
> Many thanks.
>
Received on Fri Nov 17 2000 - 16:44:41 CET

Original text of this message