Identifiers

An identifier is a token used to form a name. An identifier in an SQL statement is one of the following types:

Note:
$, @, #, and all other variant characters should not be used in identifiers because the code points used to represent them vary depending on the CCSID of the string in which they are contained. If they are used, unpredictable results may occur. For more information about variant characters, see the Variant characters topic in the iSeries Information Center.

SQL identifiers

There are two types of SQL identifiers: ordinary identifiers and delimited identifiers.

System identifiers

A system identifier is used to form the name of system objects in i5/OS. There are two types of system identifiers: ordinary identifiers and delimited identifiers.

Examples

   WKLYSAL     WKLY_SAL     "WKLY_SAL"     "UNION"     "wkly_sal"

Host identifiers

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. For example, the rules for forming a host-identifier in a COBOL program are the same as the rules for forming a user-defined word in COBOL. Names beginning with the characters 'SQ'16, 'SQL', 'sql', 'RDI', or 'DSN' should not be used because precompilers generate host variables that begin with these characters. In Java™, do not use names beginning with '__sJT_'.

See Table 2 for the limits on the maximum size of the host identifier name imposed by DB2 UDB for iSeries.


16.
'SQ' is allowed in C, COBOL, and PL/I; it should not be used in RPG.



[ Top of Page | Previous Page | Next Page | Contents | Index ]