Re: Use of Datatype
Posted by: Shawn Green
Date: April 08, 2022 02:44PM

What Peter said in the other response is correct. The simple thing to do is simply not use a display length element for those column definitions.

Here's an easy easy story to understand why:
Let's say you defined a column as INT(5). It's an INT so the value 12345678 is a legal value. If you only have 5 spots for the display, which of those 5 digits do you choose? Should the output be "12345" or "45678"? Both of those options fit the (5) that was listed in the definition but both would still be wrong. The only logical choice is to ignore any length description in the definition and show the entire value. Since we are going to ignore it, anyway, then we don't even need it in the first place.

Historically, this kind of length restriction in a table's definition had some moderate value. It could keep a single row within the useful limits of a punched card or terminal screen. We haven't had display limits like that in decades.

Options: ReplyQuote


Subject
Written By
Posted
April 08, 2022 12:30AM
April 08, 2022 09:37AM
Re: Use of Datatype
April 08, 2022 02:44PM
August 24, 2022 03:18PM
August 24, 2022 04:07PM


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.