Purpose
You can use this statement to set the client, connection, and result character set and collation.
Syntax
SET NAMES charset_name [COLLATE collation_name]
Parameters
| Parameter | Description |
|---|---|
| charset_name | Specifies the default character set of columns in the table. Valid values:
|
| collation_name | Specifies the default collation of columns in the table. Valid values:
|
Examples
Set the client, connection, and result character set to gbk and the collation to gbk_bin.
obclient> SET NAMES gbk COLLATE gbk_bin;
Query OK, 0 rows affected (0.01 sec)