Naming Rules for DB2

Observe the following general rules for names:

  • Letters, numbers, and underscores (_) are allowed, but the first character must be a letter.

  • Uniface accepts only uppercase names in the application model definition.

  • Try not to use DB2 reserved words for the names of entities or fields. These reserved words are listed in the DB2 documentation.

    However, you can instruct the connector to accept certain DB2 reserved words as field or table names by using the identifiers:quoted option.

  • Table names must also comply with Uniface rules.

Index Names

Index names have a maximum length of 30 characters.

Table Names

Table names have a maximum length of 30 characters. Names that are longer will cause errors to be returned.

On iSeries, table names longer than 10 characters will result in physical file names that are truncated to 5 characters and a 5 digit number appended. This is transparent to Uniface and to SQL, but it is not transparent to native iSeries RPG, COBOL, or CL programs or commands, so it is better to choose a name that is no longer than 10 characters.

Field Names

Field names have a maximum length of 30 characters. Names that are longer will cause errors to be returned.

On iSeries, when a field name is longer than 10 characters, it is truncated to 5 characters and a 5 digit number appended. For Uniface and SQL, this is transparent, but possibly not to external RPG, COBOL, or CL programs or commands. However, the original long name is preserved in the Column Heading and in the Alternative name of the field.