Specifying a Character Set for a Client Connection

From InterBase
Jump to: navigation, search

When a client application, such as isql, connects to a database, it may have its own character set requirements. The server providing database access to the client does not know about these requirements unless the client specifies them. The client application specifies its character set requirement using the SET NAMES statement before it connects to the database.

SET NAMES specifies the character set the server should use when translating data from the database to the client application. Similarly, when the client sends data to the database, the server translates the data from the client’s character set to the database’s default character set (or the character set for an individual column if it differs from the database’s default character set).

For example, the following isql command specifies that isql is using the DOS437 character set. The next command connects to the europe database created in Specifying a Character Set for a Column in a Table:

SET NAMES DOS437;
CONNECT 'europe.ib' USER 'JAMES' PASSWORD 'U4EEAH';

For the complete syntax of SET NAMES and CONNECT, see Language Reference Guide.