MySQL Forums :: Newbie :: Display Width Clarification (numeric data types)


Advanced Search

Display Width Clarification (numeric data types)
Posted by: Jeff Miner ()
Date: August 14, 2009 10:49AM

The certification book explains numeric data types in regards to display width: "The display width indicating the maximum number of characters to use when presenting column values in a query output." (p.61) Then, it goes on to say "When you SELECT the column in a query, mysql displays the entire value..., not just the the first four digits of the value." (p. 62)

This sort of information doesn't really help a lot.

Altogether, I've looked through the reference manual and certification study guide book, but with such contradictions and no explanation, I can't determine what display width actually does.

This is the best I can piece together with the information I can find:
1. Display width doesn't change storage requirements for the data type.
2. Display width doesn't alter the actual data in any way (ie: it stores the entire value for the data)
3. A column returns it's full value when called in a query, regardless of the display width (the book directly contradicts this claim it makes as seen above)

Are these statements true? If so, how do I SEE the values "hidden" by using a display width? Will the full values show up in a query (like the book states) or will they not (like the book states)? Does your query have to have a SELECT statement for the full value to be returned?

Is there something I am missing? I really don't see any reason to set a display width for integers with the explanations I have of them now. What benefit does setting a display width have?



Edited 1 time(s). Last edit at 08/14/2009 10:50AM by Jeff Miner.

Options: ReplyQuote


Subject Written By Posted
Display Width Clarification (numeric data types) Jeff Miner 08/14/2009 10:49AM
Re: Display Width Clarification (numeric data types) Rick James 08/15/2009 04:57PM
Re: Display Width Clarification (numeric data types) laptop alias 08/15/2009 05:59PM
Re: Display Width Clarification (numeric data types) Jeff Miner 08/16/2009 12:51PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.