Re: Help about a data type

From: Alan <>
Date: Fri, 17 Nov 2000 10:44:41 -0500
Message-ID: <8v3joo$l46$>

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


in a number type, only the
8765 is stored

where as in a string type, it will storeas


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.

<> wrote in message
> 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