Identifiers

An identifier is a token used to form a name. An identifier in an SQL statement is either an SQL identifier, a system identifier, or a host identifier.
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 on variant characters, see the book National Language Support, SC41-5101-01.

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 OS/400. 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'11, 'SQL', 'sql', 'RDI', or 'DSN' should not be used because precompilers generate host variables that begin with these characters.


Footnotes:

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


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