SQL and DBCS

The basic symbols of keywords and operators in the SQL language are single-byte characters that are part of all character sets supported by the IBM® relational database products. Characters of the language are classified as letters, digits, or special characters.

SQL host identifiers and double-byte characters

A host-identifier is a name declared in the host program. The rules for forming a host-identifier are the rules of the host language, except that DBCS characters cannot be used.

SQL character subtypes and double-byte characters

Each character string is further defined as follows:

The database manager does not recognize subclasses of double-byte characters, and it does not assign any specific meaning to particular double-byte codes. However, if you choose to use mixed data, then two single-byte EBCDIC codes are given special meanings:

In order for the database manager to recognize double-byte characters in a mixed data character string, the following condition must be met:

The length of a mixed data character string is its total number of bytes, counting two bytes for each double-byte character and one byte for each shift-out or shift-in character.

When the job CCSID indicates that DBCS is allowed, CREATE TABLE will create character columns as DBCS-Open fields, unless FOR BIT DATA, FOR SBCS DATA, or an SBCS CCSID is specified. The SQL user will see these as character fields, but the system database support will see them as DBCS-Open fields.