See the ZEROFILL column attribute:

        http://www.mysql.com/doc/en/Column_types.html

        http://www.mysql.com/doc/en/Numeric_types.html


If necessary, you can use an ALTER TABLE command to add that 
attribute to the appropriate columns.

        - steve


At 10:11 AM -0700 10/11/02, Bryan Koschmann - GKT wrote:
>Hi,
>
>Does MySQL provide for any way to "pad" a field? I have accounts numbers
>that vary from 3-5 digits, and would like them 8 digits padded by zeros
>(479 becomes 00000479, 17234 becomes 00017234, etc). I know I could
>probably write a script to fix that before entering the data into the
>database, but I just wanted to know. Or maybe there is a way to pad it
>while doing the query select?
>
>Thanks,
>
>       Bryan
>


-- 
+------------------------------------------------------------------------+
| Steve Edberg                                      [EMAIL PROTECTED] |
| University of California, Davis                          (530)754-9127 |
| Programming/Database/SysAdmin               http://pgfsun.ucdavis.edu/ |
+------------------------------------------------------------------------+
| The end to politics as usual:                                          |
|                 The Monster Raving Loony Party (http://www.omrlp.com/) |
+------------------------------------------------------------------------+

---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to