Home » Category » MySQL

MySQL: What is the practical use of ZEROFILL in your case?

206| Sun, 30 Dec 2007 22:15:00 GMT| khazretsapenov| Comments (3)
Hi,What is the practical use of ZEROFILL in your case?regards,Khaz

Keywords & Tags: practical, zerofill, case, mysql

URL: http://database.itags.org/mysql/62216/
 
«« Prev - Next »» 3 helpful answers below.
Khazret Sapenov wrote:
> What is the practical use of ZEROFILL in your case?

I have not had a need to use that feature in my projects, but sometimes
people have an integer field that must have uniform length, so they
prefer to have the leading portion fill with zeroes.

For instance:
http://groups-beta.google.com/group...090b6cac8da980/

Regards,
Bill K.

billkarwin | Sun, 30 Dec 2007 22:16:00 GMT |

Bill,
I have read the link, however it's unclear what is the "specific reason".
Anyway thank you for your time.

regards,
Khazret Sapenov

"Bill Karwin" <bill...karwin.com> wrote in message
news:cub4ol02ksa...enews3.newsguy.com...
> Khazret Sapenov wrote:
> > What is the practical use of ZEROFILL in your case?
> I have not had a need to use that feature in my projects, but sometimes
> people have an integer field that must have uniform length, so they
> prefer to have the leading portion fill with zeroes.
> For instance:
http://groups-beta.google.com/group...090b6cac8da980/
> Regards,
> Bill K.

khazretsapenov | Sun, 30 Dec 2007 22:17:00 GMT |

Khazret Sapenov wrote:
> I have read the link, however it's unclear what is the "specific reason".

The link just demonstrates that there exists a person who has that
requirement to pad integers with zeroes, and the ZEROFILL attribute was
the solution.

I think it's just a convenience. A programmer could format the value
that way after fetching it from the database, but apparently it's a
common enough task that MySQL can do it for you if you need it.

As for why someone would want this, it can help in some documents to
make integers of uniform length, so that they align with each other
regardless of being right- or left-justified.

Regards,
Bill K.

billkarwin | Sun, 30 Dec 2007 22:18:00 GMT |

MySQL Hot Answers

MySQL New questions

MySQL Related Categories