Subject | Re: mySQL ZEROFILL option its need in FireBird? |
---|---|
Author | Svein Erling |
Post date | 2004-04-29T07:27:07Z |
Hi Johannes!
If leading zeroes do matter, then I'm used to define the field as a
char or varchar - every person living in Norway has a unique 11-digit
PIN code which may start with a leading zero, so we use this kind of
field quite a lot. In general, my impression is that you never do
maths on fields where the leading zeroes are important (well, our PIN
code does include two control numbers that are calculated from the
previous digits in the PIN code, but that is maths on each individual
digit, not the PIN code as a whole), so those numbers are not all too
different from characters. To define ZEROFILL as DDL does not sound
sensible to me (although I do not know the code of Firebird), having a
UDF that does this for those who want it sounds more appropriate.
Though this subject is something that I think is more appropriate to
discuss in firebird-devel (or is it fb-devel?) or firebird-general.
Set
If leading zeroes do matter, then I'm used to define the field as a
char or varchar - every person living in Norway has a unique 11-digit
PIN code which may start with a leading zero, so we use this kind of
field quite a lot. In general, my impression is that you never do
maths on fields where the leading zeroes are important (well, our PIN
code does include two control numbers that are calculated from the
previous digits in the PIN code, but that is maths on each individual
digit, not the PIN code as a whole), so those numbers are not all too
different from characters. To define ZEROFILL as DDL does not sound
sensible to me (although I do not know the code of Firebird), having a
UDF that does this for those who want it sounds more appropriate.
Though this subject is something that I think is more appropriate to
discuss in firebird-devel (or is it fb-devel?) or firebird-general.
Set
--- In firebird-support@yahoogroups.com, Johannes Pretorius wrote:
> Good day
> =-\\-=\-=\-=\
>
> got this part out of the mySQL docs
>
> //============================================
> When used in conjunction with the optional extension attribute
> ZEROFILL, the default padding of spaces is replaced with zeros. For
> example, for a column declared as INT(5) ZEROFILL, a value of 4 is
> retrieved as 00004. Note that if you store larger values than the
> display width in an integer column, you may experience problems when
> MySQL generates temporary tables for some complicated joins, as in
> these cases MySQL trusts that the data did fit into the original
> column width.
>
> //============================================
>
> Was wondering if there is a need like this is FireBird ?. I can
> think for values that is stored for barcodes it can be handy, but
> the rest it seems has only display meaning.
>
> Is there any other need or is there a need at all in the FireBird
> userbase for this ??
>
> Just wondering :)
>
> Thanks in Advance for any comments
>
> Johannes Pretorius