Reputation: 95
I need make below code in informix 11.7
Example ORACLE:
ALTER DATABASE `DATABASE_NAME` DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci
I hope someone may help me.
Upvotes: 0
Views: 1391
Reputation: 754420
Informix does not support an ALTER DATABASE statement, and does not allow you to specify the code set that will be used declaratively.
You can set the code set that will be used when you create the database by setting the environment variable DB_LOCALE
to a suitable value (and you should normally set CLIENT_LOCALE
too). For example:
DB_LOCALE=en_US.utf8 CLIENT_LOCALE=en_US.utf8 dbaccess - - <<EOF
CREATE DATABASE database_name WITH BUFFERED LOG;
EOF
I used dbaccess
simply because it is the command-line interface; the environment can be set and the database created via any appropriate interface.
Offhand, I don't think there's a way to specify a case-insensitive collation. With Informix, that would be part of the locale, too, so there'd have to be a locale such as en_us.utf8@ci
to allow for that. I don't think such a locale is distributed by Informix.
Informix does support a SET COLLATION statement that can be used to change the collation that is used at runtime. Be cautious: the optimizer can only use indexes on character data that were built in the correct (current) locale, so using SET COLLATION can adversely effect the performance of queries.
You can find more information about Global Language Support or GLS in the IBM Information Centre for Informix.
Upvotes: 1