602SQL Documentation Index  

Identifiers and Reserved Words in SQL

Identifier Notation

Standard Identifier Notation

Standard identifiers in the SQL language begin with a letter or with an underline ("_") and may contain letters, numbers and underlines.

International characters that belong to the system charset on the server are also acceptable.

Example: I, new_value.

Identifiers Containing Non-Alphanumeric Characters

If the identifier contains non-alphanumeric characters, it must be enclosed special delimiters. Single quote or double quotes can be used as the delimiters. In order to use quotation marks, you must set the SQL compatibility attributes correctly using the Set_sql_option procedure (SQLOPT_QUOTED_IDENT option).

A delimiter cannot be used inside an identifier.

Example: "Reader's digest", `UPDATE`.

Identifiers Containing Characters that Cannot be Entered

There are characters that can be part of an identifier, but cannot be entered into the statement, because they are not on the keyboard. You can use an Unicode escape sequence for entering these characters, where each occurrence of the character is replaced with the Unicode character code. U& must always be before the identifier. Unicode escape sequence always begins with the opening Unicode Escape character and contain 4 hexadecimal digits.

Example: U&`poci\0105g`, U&`po*0142owa`UESCAPE'*' (the same as pociąg, połowa).

Identifier Properties

Identifiers may contain only characters from the database system charset.

The maximum number of characters in an identifier is 31. Identifiers are not case-sensitive.

Standard identifiers must differ from reserved words. The following words are reserved:


602SQL Variances