Having been programming in Foxpro long before there was an integer 
type I still tend to think of fields that need numbers in terms of 
the plain old original numeric field, rather than using the integer 
type. Thus to some extent I'm unfairly not thinking in apples to 
apples comparison (ie MySQL Integer to VFP Integer support).

Since moving to MySQL I've forced myself to 're-evaluate' alot of 
these things that I used to take for granted and thus I tend to try 
and use Integers wherever possible, but it's still hard for me to not 
treat any numeric field like a VFP plain numeric field.

It'd have been nice if you could use the width precision for integers 
in MySQL to behave like a Fox numeric that doesn't specify decimals 
and let MySQL translate it to the correct size of integer in the 
background, for example, if you specified INTEGER(1) or INTEGER(2), 
MySQL would use TINYINT internally. It gets a bit more complicated if 
you needed to do INTEGER(3) since that could map to TINYINT or INT 
based on the highest number needed but I'd think it could just use 
the larger type to be safe.

It's not really that big of a deal, I just find myself always 
drifting back to how numerics work in VFP when I'm in MySQL working 
with Integers. If I had been using the VFP Integer type all these 
years, then I wouldn't have any issues to complain about.. :)

Of course you're right that MySQL does support a numeric type field 
that works 'almost' the same as Foxpro (except the decimal point is 
not counted, ie in Fox: 999.99 = Numeric (6,2), but (5,2) in MySQL), 
which I could stick to using and my old habits would be happy, but 
now knowing how much of a waste that is in terms of space, I can't 
justify it to myself, so I try to do the 'right' thing and use 
integers where appropriate.


>Integer fields work the same in MySQL and VFP. VFP supports only
>32-bit signed integers, whereas MySQL supports different sizes and
>signed/unsigned. MySQL also supports a numeric/decimal type that's
>equivelent in function and definition to VFP's "numeric" field. In
>both MySQL and VFP, integer types are preferred for
>storage/performance versus numeric fields, unless fractions are
>required.
>
>
>--
>Derek
>
>
[excessive quoting removed by server]

_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/profox
OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: http://leafe.com/archives/byMID/profox/[EMAIL PROTECTED]
** All postings, unless explicitly stated otherwise, are the opinions of the 
author, and do not constitute legal or medical advice. This statement is added 
to the messages for those lawyers who are too stupid to see the obvious.

Reply via email to