Identifier

An identifier specifies the unqualified name of a database object, such as an access method, aggregate, alias, blobspace, cast, column, constraint, correlation, data type, index, operator class, partition, procedure, table, trigger, sequence, synonym, or view. Use the Identifier segment whenever you see a reference to an identifier in a syntax diagram.

Syntax

Read syntax diagramSkip visual syntax diagram
Identifier

|--+-+-letter-----+--+---------------------+-+------------------|
   | '-underscore-'  | .-----------------. | |   
   |                 | V                 | | |   
   |                 '---+-letter------+-+-' |   
   |                     +-digit-------+     |   
   |                     +-underscore--+     |   
   |                     '-dollar_sign-'     |   
   |                          (1)            |   
   '-| Delimited Identifier |----------------'   

Notes:
  1. See Delimited Identifiers
Element Description Restrictions Syntax
digit Integer in range 0 to 9 Cannot be the first character Literal Number
dollar_sign Dollar ( $ ) symbol Cannot be the first character Literal symbol entered from the keyboard.
letter Upper- or lowercase letter of the alphabet In the default locale, must be an ASCII character in the range A to Z or a to z Literal symbol entered from the keyboard.
underscore Underscore ( _ ) character Cannot substitute a space, hyphen, or other non-alphanumeric character Literal symbol entered from the keyboard.

Usage

This is a logical subset of Database Object Name, a segment that can specify the owner, database, and database server of external objects.

To include other non-alphanumeric symbols, such as a blank space (ASCII 32), in an identifier, you must use a delimited identifier. It is recommended that you do not use the dollar sign ( $ ) in identifiers, because this symbol is a special character whose inclusion in an identifier might cause conflicts with other syntax elements. For more information, see Delimited Identifiers.

An identifier must have a length of at least 1 byte, but no more than 128 bytes. For example, employee_information is valid as a table name. If you are using a multibyte code set, keep in mind that the maximum length of an identifier refers to the number of bytes, not to the number of logical characters.

For letter characters in nondefault locales, see Support for Non-ASCII Characters in Identifiers. For further information on the GLS aspects of identifiers, see Chapter 3 of the HCL Informix GLS User's Guide.

When you use ESQL/C with Informix® , the database server checks the internal version number of the client application and the setting of the IFX_LONGID environment variable to determine whether a client application supports long identifiers (up to 128 bytes in length). For more information, see the HCL Informix Guide to SQL: Reference.

When the database server uses long identifiers, you might encounter error messages, warning messages, or other messages that truncate trailing characters in SQL identifiers or elsewhere in the message text. Truncation can usually be avoided, however, if identifiers have 18 or fewer bytes. Your code might be difficult to read or to maintain if identifiers of different SQL objects are identical in their first 18 characters.


Copyright© 2021 HCL Technologies Limited