Delimited identifiers

If an identifier name does not conform to naming conventions, you must use a delimited identifier. A delimited identifier is an SQL identifier that is enclosed in double quotation marks, " ".

When you use double quotation marks to delimit identifiers, you conform to ANSI standards; single quotation marks (' ') delimit strings.

Use delimited identifiers when your program must specify some identifier name that would otherwise be syntactically invalid. Examples of possible invalid identifiers include:
  • An identifier that is the same as an SQL reserved word.

    For a list of SQL reserved words, see the description of identifiers in the HCL OneDB™ Guide to SQL: Syntax.

  • An identifier that does not contain alphabetic characters.
To use delimited identifiers, you must compile and run your program with the DELIMIDENT environment variable set. You can set DELIMIDENT at either of the following phases:
  • At compile time, the preprocessor allows quoted strings in areas of the SQL syntax where identifiers are valid.
  • At run time, the database server accepts quoted strings in dynamic SQL statements where identifiers are valid.

    Database utilities such as dbexport and DB-Access also accept delimited identifiers.

Important: When you use the DELIMIDENT environment variable, you can no longer use double quotation marks to delimit strings. If you want to indicate a quoted string, enclose the text with single quotation marks (' ').

Delimited identifiers are case sensitive. All database object names that you place within quotation marks maintain their case. Keep in mind that restricts identifier names to a maximum of 128 characters.

The following restrictions apply to delimited identifiers:
  • You cannot use a delimited identifier for a database name.
  • You cannot use a delimited identifier for a storage identifier, for instance, the name of a dbspace.

    The DELIMIDENT environment variable applies only to database identifiers.