Reply
standard data types for ZIP CODES, PHONE NUMBERS, etc
Old 08-10-2006, 01:12 PM standard data types for ZIP CODES, PHONE NUMBERS, etc
Junior Talker

Posts: 1
is there a link to some standard, universally accepted data types and sizes for common entries such as zip codes, phone numbers etc??? i am getting more involved in database work and i want to avoid problems with my data types... thanks in advance
leggo77 is offline
Reply With Quote
View Public Profile
 
When You Register, These Ads Go Away!
Old 08-11-2006, 11:29 AM Re: standard data types for ZIP CODES, PHONE NUMBERS, etc
Minaki's Avatar
Defies a Status

Posts: 1,626
Location: Guildford, UK
It depends what type of database you're using. ZIP and Phone numbers would usually be a text based field, such as VARCHAR in MSSQL.
__________________
Minaki Serinde MCP
"Wow, Linux is nearly on-par with Windows ME!"
Inoxia Pyrotechnics Supplies | Surrey Angels Cheerleading Squad
Minaki is offline
Reply With Quote
View Public Profile Visit Minaki's homepage!
 
Old 08-12-2006, 11:46 AM Re: standard data types for ZIP CODES, PHONE NUMBERS, etc
reli4nt's Avatar
Extreme Talker

Posts: 153
Location: New York
It is largely a matter of personal preference since many options will produce the same results. Sometimes there are small reasons you may use to choose one over the other. For example, I generally use INTEGER for phone numbers keeping a separate fields for area code, exchange, and the last 4 numbers. I do this because it's easier to secure a integer input than it is to secure text. I also find is easier to search by area cosde or exchange in large databases this way.

In the end whatever works is fine, but simply let practice and individual circumstance be your guide.
__________________
The JPProject Multimedia
Designing the world we live in.
Defining the terms we live by.
reli4nt is offline
Reply With Quote
View Public Profile Visit reli4nt's homepage!
 
Old 08-12-2006, 06:34 PM Re: standard data types for ZIP CODES, PHONE NUMBERS, etc
Minaki's Avatar
Defies a Status

Posts: 1,626
Location: Guildford, UK
Phone numbers should not be stored as integers. While it may work in most cases, phone numbers are not really 'numbers' as such - they are strings of numbers. For example, you wouldn't do a calculation on a phone number. Also, what if a phone number starts with a Zero? Store that in a database as an integer, and the database will drop the leading zero and when you retreive it, the phone number will be wrong.
__________________
Minaki Serinde MCP
"Wow, Linux is nearly on-par with Windows ME!"
Inoxia Pyrotechnics Supplies | Surrey Angels Cheerleading Squad
Minaki is offline
Reply With Quote
View Public Profile Visit Minaki's homepage!
 
Old 08-13-2006, 01:29 AM Re: standard data types for ZIP CODES, PHONE NUMBERS, etc
reli4nt's Avatar
Extreme Talker

Posts: 153
Location: New York
good point regarding the leading zeros.
__________________
The JPProject Multimedia
Designing the world we live in.
Defining the terms we live by.
reli4nt is offline
Reply With Quote
View Public Profile Visit reli4nt's homepage!
 
Reply     « Reply to standard data types for ZIP CODES, PHONE NUMBERS, etc
 

Thread Tools

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 Off
Pingbacks are Off
Refbacks are Off




   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML

 


Page generated in 0.12220 seconds with 12 queries