If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > MySQL > Maximum display width on Integer types !?

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 12-12-06, 03:03
fischermx fischermx is offline
Registered User
 
Join Date: Dec 2006
Posts: 15
Maximum display width on Integer types !?

I'm in my first days with MySQL and I have a doubt about something I've just read in the manual.
They talk about a maximum display width for integer types (!?):
M indicates the maximum display width for integer types. For floating-point and fixed-point types, M is the total number of digits. For string types, M is the maximum length. The maximum allowable value of M depends on the data type.


I understand what's is this on String types as it make sense. As well as floating and fixed points, where you should specify the digits/decimals.
But I just don't get it what the heck has a "display" to do with database storage related to an Integer type ?
What's display about !? Display what ? where ?

Thanks in advance!
Reply With Quote
  #2 (permalink)  
Old 12-12-06, 06:17
r937 r937 is offline
SQL Consultant
 
Join Date: Apr 2002
Location: Toronto, Canada
Posts: 19,534
the number in parentheses after a numeric datatype, e.g. integer(11), indicates how many digits to display when using the ZEROFILL option

so if the value is 937, and you have integer(11) zerofill, then when you display the value, it displays as 00000000937

that's all it's used for
__________________
r937.com | rudy.ca
please visit Simply SQL and buy my book
Reply With Quote
  #3 (permalink)  
Old 12-13-06, 02:11
fischermx fischermx is offline
Registered User
 
Join Date: Dec 2006
Posts: 15
Thanks for the explanation !
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On