The length of an html form is calculated based on the number of characters, whether it is a Chinese character or a letter, but the database is calculated by byte. The number of Chinese characters occupies 1 of 2 letters, in this way, the length of
A problem with the recent project is the need to get the field length defined by the table in the Oracle database, and then verify that the data that will be entered into the database table exceeds the length of the field definition. So understand
HTML form length is calculated by the number of characters, whether it is Chinese characters or letters, but the database is also in bytes, the Chinese characters accounted for 2 letters accounted for 1, so it is easy to write the length of the
You see this article from HTTP://WWW.CNBLOGS.COM/AYANMWReprinted from: http://blog.csdn.net/daydreamingboy/article/details/6310907Analyze the length of the MySQL data typeMySQL has several data types that can limit the "length" of a type, with char (
When the actual oracle value exceeds the specified length of a database field, an error is reported. oracle Length
ORA-01438: value larger than specified precision allowed for this column
The length of the actual value is greater than the maximum
Type of a value
Storage required for column typesTINYINT 1 bytesSMALLINT 2 bytesMediumint 3 bytesINT 4 bytesINTEGER 4 bytesBIGINT 8 bytesFLOAT (x) 4 if X FLOAT 4 bytesDOUBLE 8 bytesDOUBLE PRECISION 8 bytesReal 8 bytesDECIMAL (m,d) m bytes (d+2, if
In mysql, we only need to use alter to modify the data table fields. Below I will introduce how to modify the table field name, field length, and field type in mysql, for more information, see.
Let's take a look at common methods.
The simple Syntax
There are a lot of related to char and varchar on the Internet, but all have a long history, here reprint a piece of information relatively new, personally think to my design field decision help very much.
Modern databases generally support char
Citation: Http://www.2cto.com/database/201209/155178.htmlSQL statement gets all database names, table names, field names, table fields length gets all the tables in the database select Sysobjects.name as Tablename from sysobjects WHERE xtype = ' U '
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.