Hi Scott, all!

Scott Haneda wrote:
I need to update a column, if the string length is less than 5, I want to
add leading zeros to it until it has 5.  These are zip codes, I think there
are no 00 leading zips, so most should all be four chars long.

This sounds like the columns were of a numeric data type.

If this is so, IMNSHO it was a wrong decision:
Zip codes are character strings, even though they may (in some / many countries) consist of digits only.
Use a "char (n)" column for them, with "n" varying by country.

If you have/want to support international addresses, check for the largest value occurring: Dutch or British postal codes are longer than German or US ones, there may be longer ones elsewhere.


Regards,
Joerg

--
Joerg Bruehe, Senior Production Engineer
MySQL AB, www.mysql.com

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to