SQL select command
SELECT a.RDB$CHARACTER_SET_NAME FROM RDB$DATABASE a
returns NULL. What character set is used when not specified any when creating new database? Is there difference between various versions of Firebird (1.0, 2.0, 2.5.1 etc.)?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The default character set for a database when no character set was specified during creation is character set
NONE, see page 47 of the Interbase 6.0 Data Definition Guide (available in the documentation section of the firebird website). This has been the way since before Firebird (probably since the creation of Interbase) and still applies to the existing versions. However, under Firebird 2.5 when a database is created without a default character set, thenRDB$CHARACTER_SET_NAMEwill have valueNONE. I am not sure if this was different in earlier versions, my guess would still be it usesNONEas the default even if it reportsNULL.If you want to be sure, you can simply create a basic table with a
CHARorVARCHARcolumn without a character set specification, and then use the following query to determine the default:You can use this to find the character set of any (
(VAR)CHAR) field BTW.Character set
NONEmeans that there is no character set assumptions, so you can store data in it in any characterset. However you cannot store or compare it to a column that has an explicit character set (except maybe character setOCTETS, not sure about that).If you use
NONEthen you need to make sure you always use the same connection character set when connecting to the database or if you use character setNONEas a connection character set, that your application, driver, access component or programming language always uses the same encoding, otherwise you’ll get transliteration problems (character encoding problems).Using
NONEas the connection character set has additional issues. For example the data of a column will always be sent as is, and stored as received except when a byte combination is not allowed in the character set of the column. Basically it means database must be used in the same language environment it was created on.In general it is better to be explicit about the default character set, unless you know what you are doing.