Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re: Question about phone number storage.

by lzcd (Pilgrim)
on Jan 18, 2001 at 06:32 UTC ( [id://52673]=note: print w/replies, xml ) Need Help??


in reply to Question about phone number storage.

My Choice (TM) is Var Char as it avoids a lot of the possible nasty conversions that could face a large int.

Also it allows for future alpha things such as the international '+' and the area code '()'s.

Update:Also using int's brings up a few nasties when it comes to leading zero's. eg. 02 987654321 becomes 2987654321.
  • Comment on Re: Question about phone number storage.

Replies are listed 'Best First'.
Re: Re: Question about phone number storage.
by extremely (Priest) on Jan 19, 2001 at 05:05 UTC
    Unless the database is huge or performance isn't a concern you should probably just use a char field. The real payoff of varchar is wildly variable data where most of the time the varchar field would be small. In these days of huge hard-drives you might as well fix the field at the largest size and get the performance win of the DB knowing how many records per page you will have. If neither performance nor size matter, do what-ever makes you happy! =)

    varchar for size, char for speed

    P.S. The same boss that insists on int's will one day ask you how you can get (1-555-use-perl) in that DB...

    --
    $you = new YOU;
    honk() if $you->love(perl)

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others surveying the Monastery: (3)
As of 2024-04-19 17:03 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found