MySQL numeric fields work very different than they do in VFP, and I 
found this very confusing at first (still do actually as old habits die hard)..

Unlike VFP, for numeric fields, the field's size (ie the maximum 
number allowed in the field) is dictated only by the type you choose, 
ie, tinyint, int, etc..

TINYINT cannot except any value > 255 in it's field for UNISGNED and 
127 for SIGNED.

There's no concept of # of digits it can hold. I find this a bit 
confusing honestly, and prefer to think in VFP terms, but maybe 
that's just my habits again..

The (x) part, ie TINYINT(2) for example is an optional display size 
that is used mostly in conjunction with the zero fill keyword.

Thus:
TINYINT (2) ZEROFILL

for values, 1,3,9,10,20,127 will appear as:

01
03
09
10
20
127

TINYINT(3) ZEROFILL
001
003
009
010
020
127

I'm not quite sure how it relates when not used in conjunction with 
the ZEROFILL descriptor.

Hope this helps clarify for you.

Steve


At 01:51 PM 4/27/2007, you wrote:
>Got a question on the bits parameter.  From the MySQL website:
>
>|TINYINT[(/|M|/)] [UNSIGNED] [ZEROFILL]|
>
>A very small integer. The signed range is |-128| to |127|. The unsigned
>range is |0| to |255|.
>
>So if the number is always going to be in that range, what's the point
>of the M value?  Does TINYINT(1) mean different than TINYINT(4)?  If
>2**8 = 256, then would that mean the maximum declaration for TINYINT
>could be TINYINT(8), and likewise the max value for TINYINT(7) is 2**7,
>etc. etc. ??
>
>Just wanted to clarify this as it's bugged me.
>
>tia!
>
>--
>Michael J. Babcock, MCP
>MB Software Solutions, LLC
>http://mbsoftwaresolutions.com
>http://fabmate.com
>"Work smarter, not harder, with MBSS custom software solutions!"
>
>
>
[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