Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re: Question about phone number storage.

by bastard (Hermit)
on Jan 19, 2001 at 03:23 UTC ( [id://52874]=note: print w/replies, xml ) Need Help??


in reply to Question about phone number storage.

I've been struggling with this one for a while on a DB i've been creating.

Basically I agree and disgree with what has been said so far.
Phone numbers are quite complex when you look at all the telecoms in the world. Nothing is standard. For this reason I think I agree with varchar. (mostly to get the breaks right)

Don't store country codes with the numbers. Store the country(prolly full address too) of the number in the DB and have the country code and whatever extra dialing specifics added on the fly based upon where you are.
At least that's the direction I plan of traveling down.

The other question is how big? I'd love to know the answer to that one. The largest number i have seen (with country code I think) was about 17 chars. I wasn't even thinking about extentions at the time (probably better as a separate field). I went with about 20 chars, just to cover everything I could think of. If anyone knows what the longest phone number is (with and without country code) i'd be very interested.

  • Comment on Re: Question about phone number storage.

Replies are listed 'Best First'.
Re: Re: Question about phone number storage.
by tye (Sage) on Jan 19, 2001 at 03:43 UTC

    From my vague memory, the ITU used to limit phone numbers to a total of 16 digits (that includes country code). They recently (within the last 3 years) had to increase that limit and I think it is now 20 total digits which means that there aren't any phone numbers that long yet. So you'd probably want to allow something like 32 character so you've got room for formatting. Having to decide field lengths is one of the things I hate about most relation databases.

    I'd recommend storing the country code with the phone number myself.

            - tye (but my friends call me "Tye")

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://52874]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others rifling through the Monastery: (4)
As of 2024-04-24 01:59 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found