Specifying a Default Character Set

From InterBase
Jump to: navigation, search

Go Up to Creating a Database (Creating Metadata)


A default character set designation of a database specifies the character set the server uses to transliterate and store CHAR, VARCHAR, and text Blob data in the database when no other character set information is provided. A default character set should always be specified for a database when it is created with CREATE DATABASE.

To specify a default character set, use the DEFAULT CHARACTER SET clause of CREATE DATABASE. For example, the following statement creates a database that uses the ISO8859_1 character set:

EXEC SQL
CREATE DATABASE 'europe.ib' DEFAULT CHARACTER SET ISO8859_1;

If you do not specify a 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 later move that data into another column that has been defined with a different character set. In this case, no transliteration is performed between the source and destination character sets, and errors may occur during assignment.

For a complete description of the DEFAULT CHARACTER SET clause and a list of the character sets supported by InterBase, see the Data Definition Guide.