>From an old-timer: When defining a field, the basic principle is that "if you don't intend to add, subtract, multiply or divide it don't make it any type of numeric field. Make it a character field."
An excellent example of the problem is in an Excel spreadsheet. If you have a column that contains a zip code you WILL lose leading zeros (Eastern US states) when you save the sheet out to a text file. You can sit there all day and click on the column property that designates it as Text but Excel will not believe you when it comes to exporting the data. The only workaround is to replace the column throughout the sheet with "A" plus the zip code. Then in the importing application, remove the "A". Patrick -----Original Message----- From: Bernd Tannenbaum [mailto:[EMAIL PROTECTED] Sent: Thursday, November 06, 2003 5:30 AM To: [EMAIL PROTECTED] Subject: Re: keep leading 000 -solved Am Donnerstag, 6. November 2003 13:14 schrieb Bernd Tannenbaum: > Hi all, > only small problem here (me hopes). > I update a field with a value that is stored in a bash-variable. > The value in the variable ($dsvar2) is like "000012.0000". > So what i want is to keep the leading and trailing "0" in the value. > > in the bash-scipt: > /mysql -e "UPDATE table > SET field=$dsvar2 WHERE id=$i" db --password=xx; Ok, my mistake..... Set field='$dsvar2' This way the string is written completely, "Text" as field type works. Thx, Bernd -- One OS to rule them all, one OS to find them. One OS to bring them all, and in the darkness bind them In the land of Redmond, where the shadows lie. -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED] -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]