VARCHAR2 (* char) and VARCHAR2 (*)
A Hibernate automatic table was recently used, and when a string is used, the VARCHAR2 type field is created by default, such as setting length=10, after which the field property is Varchar2 (. Char), not VARCHAR2 (10).
Because I didn't notice this before, I checked it on the internet before I knew that the original foundation was not remembered (perhaps it was not contacted at first, at least the latter was always used in the impression). In fact, this two writing is really a bit different, varchar2 (Ten char) represents 10 characters, this type can store 10 multibyte characters, such as 10 Chinese characters, and VARCHAR2 (10) In fact, the city Varchar2 (byte) of the shorthand, Represents two bytes, note that the former is a character and here is a byte, which means that the type cannot store 10 multibyte characters.
varchar and VARCHAR2
VarChar is not fixed in length, for example, you define varchar (20), and when you insert ABC, it takes up only 3 bytes in the database.
VarChar also distinguishes between Chinese and English, this same char.
VARCHAR2 is essentially equivalent to varchar, which is a non-industrial standard varchar defined by Oracle, except that VARCHAR2 NULL in place of varchar null string
The VARCHAR/VARCHAR2 is suitable for the length not fixed, generally does not contain the Chinese situation
To find, to sum up, in case of forgetting. Play the database is relatively few, the proficient not to clap!