Verify the database locale

To open an existing database, the client application must correctly identify the database locale for that database.

To verify the database locale, the database server compares the following two locales:
  • The locale specified by DB_LOCALE that the client application sends
  • The database locale that is stored in the system catalog of the database that the client application requests.

    For more information, see The database locale.

Two database locales match if their language, territory, code set, and any locale modifiers are the same. If these database locales do not match, the database server performs the following actions:
  • It sets the eighth character field of the SQLWARN array in the SQL Communications Area (SQLCA structure) to W as a warning flag. Values for W are ASCII 32 (blank) and ASCII 87 (W).
  • It uses the database locale that is stored in the system catalog of the requested database as the database locale.
Important: Check for the SQLWARN warning flag after your client application requests a connection. If the two database locales do not match, the client application might incorrectly interpret data that it retrieves from the database server, or the database server might incorrectly interpret data that it receives from the client. If you proceed with such a connection, it is your responsibility to understand the format of the data that is being exchanged.

Copyright© 2020 HCL Technologies Limited