Oracle FAQ Your Portal to the Oracle Knowledge Grid

Home -> Community -> Usenet -> comp.databases.theory -> Re: How should I type my data- ZIP codes and States/Regions

Re: How should I type my data- ZIP codes and States/Regions

From: Philip Lijnzaad <>
Date: 2000/04/19
Message-ID: <>

David> As far as state is concerned, the best bet is to use the same 2 letter David> codes the US Postal Service does.

which are not the same codes as ISO, which are listed below. Taken from the emacs file mail-extr.el. Cheers,


;; Table of top-level domain names.
;; This is used during address canonicalization; be careful of format changes.
;; Keep in mind that the country abbreviations follow ISO-3166. There is
;; a U.S. FIPS that specifies a different set of two-letter country
;; abbreviations.

(defconst mail-extr-all-top-level-domains   (let ((ob (make-vector 509 0)))

      (lambda (x)
	(put (intern (downcase (car x)) ob)
	     (if (nth 2 x)
		 (format (nth 2 x) (nth 1 x))
	       (nth 1 x)))))
       ;; ISO 3166 codes:
       ("ad" "Andorra")
       ("ae" "United Arab Emirates")
       ("ag" "Antigua and Barbuda")
       ("al" "Albania")
       ("am" "Armenia")
       ("ao" "Angola")
       ("aq" "Antarctica")		; continent
       ("ar" "Argentina"	"Argentine Republic")
       ("at" "Austria"		"The Republic of %s")
       ("au" "Australia")
       ("az" "Azerbaijan")
       ("ba" "Bosnia-Herzegovina")
       ("bb" "Barbados")
       ("bd" "Bangladesh")
       ("be" "Belgium"		"The Kingdom of %s")
       ("bf" "Burkina Faso")
       ("bg" "Bulgaria")
       ("bh" "Bahrain")
       ("bm" "Bermuda")
       ("bo" "Bolivia"		"Republic of %s")
       ("br" "Brazil"		"The Federative Republic of %s")
       ("bs" "Bahamas")
       ("bw" "Botswana")
       ("by" "Belarus")
       ("bz" "Belize")
       ("ca" "Canada")
       ("cg" "Congo")
       ("ch" "Switzerland"	"The Swiss Confederation")
       ("ci" "Ivory Coast")
       ("cl" "Chile"		"The Republic of %s")
       ("cm" "Cameroon")		; In .fr domain
       ("cn" "China"		"The People's Republic of %s")
       ("co" "Colombia")
       ("cr" "Costa Rica"	"The Republic of %s")
       ("cs" "Czechoslovakia")
       ("cu" "Cuba")
       ("cy" "Cyprus")
       ("cz" "Czech Republic")
       ("de" "Germany")
       ("dk" "Denmark")
       ("dm" "Dominica")
       ("do" "Dominican Republic"	"The %s")
       ("dz" "Algeria")
       ("ec" "Ecuador"		"The Republic of %s")
       ("ee" "Estonia")
       ("eg" "Egypt"		"The Arab Republic of %s")
       ("er" "Eritrea")
       ("es" "Spain"		"The Kingdom of %s")
       ("et" "Ethiopia")
       ("fi" "Finland"		"The Republic of %s")
       ("fo" "Faroe Islands")
       ("fr" "France")
       ("ga" "Gabon")
       ("gb" "United Kingdom")
       ("gd" "Grenada")
       ("ge" "Georgia")
       ("gf" "Guyana (Fr.)")
       ("gj" "Fiji")
       ("gl" "Greenland")
       ("gm" "Gambia")
       ("gp" "Guadeloupe (Fr.)")
       ("gr" "Greece"		"The Hellenic Republic (%s)")
       ("gt" "Guatemala")
       ("gu" "Guam (U.S.)")
       ("hk" "Hong Kong")
       ("hn" "Honduras")
       ("hr" "Croatia"		"Croatia (Hrvatska)")
       ("ht" "Haiti")
       ("hu" "Hungary"		"The Hungarian Republic")
       ("id" "Indonesia")
       ("ie" "Ireland")
       ("il" "Israel"		"The State of %s")
       ("im" "Isle of Man"	"The %s")
       ("in" "India"		"The Republic of %s")
       ("ir" "Iran")
       ("is" "Iceland"		"The Republic of %s")
       ("it" "Italy"		"The Italian Republic")
       ("jm" "Jamaica")
       ("jo" "Jordan")
       ("jp" "Japan")
       ("ke" "Kenya")
       ("kn" "St. Kitts, Nevis, and Anguilla")
       ("kp" "Korea (North)")
       ("kr" "Korea (South)")
       ("kw" "Kuwait")
       ("kz" "Kazakhstan")
       ("lb" "Lebanon")
       ("lc" "St. Lucia")
       ("li" "Liechtenstein")
       ("lk" "Sri Lanka"	"The Democratic Socialist Republic of %s")
       ("ls" "Lesotho")
       ("lt" "Lithuania")
       ("lu" "Luxembourg")
       ("lv" "Latvia")
       ("ma" "Morocco")
       ("mc" "Monaco")
       ("md" "Moldova"		"The Republic of %s")
       ("mg" "Madagascar")
       ("mk" "Macedonia")
       ("ml" "Mali")
       ("mo" "Macau")
       ("mt" "Malta")
       ("mu" "Mauritius")
       ("mv" "Maldives")
       ("mw" "Malawi")
       ("mx" "Mexico"		"The United Mexican States")
       ("my" "Malaysia"		"%s (changed to Myanmar?)")		;???
       ("mz" "Mozambique")
       ("na" "Namibia")
       ("nc" "New Caledonia (Fr.)")
       ("ne" "Niger")			; In .fr domain
       ("ni" "Nicaragua"	"The Republic of %s")
       ("nl" "Netherlands"	"The Kingdom of the %s")
       ("no" "Norway"		"The Kingdom of %s")
       ("np" "Nepal")			; Via .in domain
       ("nu" "Niue")
       ("nz" "New Zealand")
       ("pa" "Panama")
       ("pe" "Peru")
       ("pf" "Polynesia (Fr.)")
       ("pg" "Papua New Guinea")
       ("ph" "Philippines"	"The Republic of the %s")
       ("pk" "Pakistan")
       ("pl" "Poland")
       ("pr" "Puerto Rico (U.S.)")
       ("pt" "Portugal"		"The Portuguese Republic")
       ("py" "Paraguay")
       ("qa" "Qatar")
       ("re" "Reunion (Fr.)")		; In .fr domain
       ("ro" "Romania")
       ("ru" "Russian Federation")
       ("sa" "Saudi Arabia")
       ("sc" "Seychelles")
       ("sd" "Sudan")
       ("se" "Sweden"		"The Kingdom of %s")
       ("sg" "Singapore"	"The Republic of %s")
       ("si" "Slovenia")
       ("sj" "Svalbard and Jan Mayen Is.") ; In .no domain
       ("sk" "Slovakia"		"The Slovak Republic")
       ("sm" "San Marino")
       ("sn" "Senegal")
       ("sr" "Suriname")
       ("su" "U.S.S.R."		"The Union of Soviet Socialist Republics")
       ("sz" "Swaziland")
       ("tg" "Togo")
       ("th" "Thailand"		"The Kingdom of %s")
       ("tm" "Turkmenistan")		; In .su domain
       ("tn" "Tunisia")
       ("to" "Tonga")
       ("tr" "Turkey"		"The Republic of %s")
       ("tt" "Trinidad and Tobago")
       ("tw" "Taiwan")
       ("ua" "Ukraine")
       ("uk" "United Kingdom"	"The %s of Great Britain and Northern Ireland")
       ("us" "United States"	"The %s of America")
       ("uy" "Uruguay"		"The Eastern Republic of %s")
       ("vc" "St. Vincent and the Grenadines")
       ("ve" "Venezuela"	"The Republic of %s")
       ("vi" "Virgin Islands (U.S.)")
       ("vn" "Vietnam")
       ("vu" "Vanuatu")
       ("yu" "Yugoslavia"	"Yugoslavia, AKA Serbia-Montenegro")
       ("za" "South Africa"	"The Republic of %s")
       ("zw" "Zimbabwe"		"Republic of %s")
       ;; Special top-level domains:
       ("arpa" t		"Advanced Research Projects Agency (U.S. DoD)")
       ("bitnet" t		"Because It's Time NET")
       ("com" t			"Commercial")
       ("edu" t			"Educational")
       ("gov" t			"Government (U.S.)")
       ("int" t			"International (NATO)")
       ("mil" t			"Military (U.S.)")
       ("nato" t		"North Atlantic Treaty Organization")
       ("net" t			"Network")
       ("org" t			"Non-profit Organization")
       ;;("unter-dom" t		"? (Ger.)")
       ("uucp" t		"Unix to Unix CoPy")
       ;;("fipnet" nil		"?")

Not getting what you want is sometimes a wonderful stroke of luck.
Philip Lijnzaad, | European Bioinformatics Institute,rm A2-24
+44 (0)1223 49 4639                 | Wellcome Trust Genome Campus, Hinxton
+44 (0)1223 49 4468 (fax)           | Cambridgeshire CB10 1SD,  GREAT BRITAIN
PGP fingerprint: E1 03 BF 80 94 61 B6 FC  50 3D 1F 64 40 75 FB 53
Received on Wed Apr 19 2000 - 00:00:00 CDT

Original text of this message