An SQL identifier is a string of letters, digits, and underscores that represents the name of a database object such as a table, column, index, or view.
A non-delimited SQL identifier must begin with a letter or underscore ( _ ) symbol. Trailing characters in the identifier can be any combination of letters, digits, underscores, or (for Dynamic Server only) dollar ( $ ) signs. Delimited identifiers, however, can include any character in the code set of the database locale; see Delimited Identifiers for more information.
Declaring identifiers that are SQL keywords can cause syntactic ambiguity or unexpected results. For additional information, see the Identifier segment in the IBM Informix: Guide to SQL Syntax. See also Non-ASCII Characters in Identifiers and Valid Characters in Identifiers.
SQL identifiers can occupy up to 128 bytes on Dynamic Server, or up to 18 bytes on Extended Parallel Server. When you declare identifiers, make sure not to exceed the size limit for your database server. For example, the following statement creates a synonym name of 8 multibyte characters:
CREATE SYNONYM A1A2A3B1B2C1C2C3D1D2E1E2F1F2G1G2H1H2 FOR A1A2B1B2
The synonym declared in the preceding example is 18 bytes long (six 2-byte multibyte characters and two 3-byte multibyte characters), so it does not exceed the maximum length for identifiers on Extended Parallel Server. The following CREATE SYNONYM statement, however, generates an error because the total number of bytes in this synonym name is 20:
CREATE SYNONYM A1A2A3B1B2B3C1C2C3D1D2D3E1E2F1F2G1G2H1H2 FOR A1A2B1B2
This statement specifies four 3-byte characters and four 2-byte characters for the synonym. Even though the synonym name has only eight characters, the total number of bytes in the synonym name is 20 bytes, which exceeds the maximum length for an identifier.