When there is No Default Character Set
Go Up to Using CREATE DATABASE
If you do not specify a default character set, the character set defaults to NONE
. Using CHARACTER SET NONE
means that there is no character set assumption for columns; data is stored and retrieved just as you originally entered it. You can load any character set into a column defined with NONE
, but you cannot load that same data into another column that has been defined with a different character set. No transliteration will be performed between the source and destination character sets, so in most cases, errors will occur during the attempted assignment.
For example:
CREATE TABLE MYDATA (PART_NUMBER CHARACTER(30) CHARACTER SET NONE); SET NAMES LATIN1; INSERT INTO MYDATA (PART_NUMBER) VALUES ('à'); SET NAMES DOS437; SELECT * FROM MYDATA;
The data (“à”) is returned just as it was entered, without the à being transliterated from the input character (LATIN1
) to the output character (DOS437
). If the column had been set to anything other than NONE
, the transliteration would have occurred.