Previous Topic: Ordinary SQL identifiersNext Topic: Naming Conventions


Delimited SQL identifiers

A delimited SQL identifier is a sequence of one or more characters enclosed within SQL escape characters. Enclosing a name within SQL escape characters allows a name to be used which is the same as an SQL reserved word (see Reserved Words for a list of the SQL reserved words.) The escape character is the quotation mark (") unless the plan option STRDELIM= has been set to Q, in which case the escape character is the apostrophe (').

In the following example, the column named SELECT is enclosed in escape characters (quotation marks in the example) to show that the SQL reserved word SELECT is not what is meant.

 CREATE TABLE SAMPLE
    ("SELECT" CHAR(6) DEFAULT 'SELECT',
      COL2 INTEGER)

 ...
 SELECT "SELECT" FROM SAMPLE
 WHERE "SELECT" = 'SELECT'