Naming conventions

Ensure that names of your objects adhere to the naming conventions for QMF.

Names with single-byte characters

The following naming rules apply when saving objects in the database.

  • Names for queries, forms, procedures, tables, and views must be unique. (You cannot have a query and a form with the same name.)
  • Names cannot start with a number.
  • A name enclosed in double quotation marks can start with any character except a double quotation mark or a blank.
    Attention: Although Db2® allows double quotation marks in database object names, names of this type are not supported by QMF. QMF commands that reference object names that include a double quotation mark will result in an error, even if the entire object name is enclosed in double quotation marks. To delete an object that has a double quotation mark in its name, use the Db2 DROP statement from the SQL Query panel.
  • You can use any character in a QMF object name except the following special characters:
     .  ,  ;  :  <  >  (  )  |  +  -  *  /     =  &   ¬  '  "
    In some non-English single-byte character sets, the not sign (¬) displays as a circumflex (‸); the vertical bar (|) displays as an exclamation point (!).
  • Avoid using the special characters listed above in the name of a table, view, or other database object. If you use any of the special characters in SQL names, you must enclose the entire name in double quotation marks.
  • A fully-qualified name (of the form location.owner.name) cannot be longer than 280 characters. The location qualifier can be up to 16 bytes; the owner qualifier can be up to 128 bytes; and the name of the object can be up to 128 bytes. For example, the following is a fully-qualified name:
    NEW_YORK.Q.STAFF
  • Do not use QMF reserved words for names because, when used in a QMF command, they will never refer to something in the database. The QMF reserved words are:
    CHART  FORM  QUERY  DATA  TABLE  PROC  REPORT  FORM  PROFILE
  • Do not use SQL reserved words for names.

Names with double-byte characters

If your site supports double-byte character set (DBCS) data, you can use double-byte characters alone or mixed with single-byte character set (SBCS) data in your names.

The following rules apply when using double-byte characters:

  • Names with both double-byte and single-byte characters can contain the same single-byte characters described earlier.
  • You can specify column headings in a form with mixed double-byte and single-byte characters. A heading consisting of double-byte characters only can be up to 19 double-byte characters long.
  • Object names containing only double-byte characters can be no more than 63 double-byte characters. A name can be qualified by a user ID. The user ID can contain either all single-byte or all double byte characters. User IDs can be up to 128 single-byte characters or 63 double-byte characters on all databases except DB2® for VSE and VM, where user IDs must be up to eight single-byte characters or three double-byte characters.
  • If your database specifically supports double-byte characters in table names, all names can contain any double-byte characters.
  • If your database does not specifically support DBCS data in table names, all names can contain any double-byte characters except those that are represented internally as a double quotation mark (X'7F').