DB2 Server for VSE & VM: Database Services Utility


Names and Identifiers

General Rules for Naming Data Objects

The DB2 Server for VSE & VM Application Programming manual contain the formal definition of the SQL language and naming conventions. Briefly, the names of data objects (such as tables, columns, indexes, synonyms, or dbspaces) must be a particular kind of character string called an identifier. SQL identifiers must begin with a letter or number. They can contain up to 18 uppercase and lowercase letters, numbers, and underscores.
Note:If you need national language character translation for lowercase terminal input, the CMS SET INPUT xx yy command can be used. Refer to the VM/ESA: CMS Command Reference manual for more information.

The preprocessor used by the Database Services Utility for dynamic SQL statement processing converts DB2 Server for VSE & VM identifiers to uppercase if they are not in double quotation marks. For example, these two identifiers are identical to the system:

department      DEPARTMENT

If you want the system to recognize the lowercase letters in the identifier, enclose the identifier in double quotation marks. For example:

"department"

Qualifying Object Names

If a data object (such as a table, dbspace, or view) is owned by another user, you need to qualify references to the object by concatenating the owner's user identifier as in the following figure:

Figure 60. Object Names

 
     SMITH.DEPARTMENT
     --*-- ----*-----
       |       |           *-----------*
       |       *------->   |table name |
       |                   *-----------*
       |
       |                   *-------------------*
       *--------------->   |owner of the table |
                           *-------------------*

The period (.) is the concatenation symbol.

You can access another user's table only if you know that person's user identifier and have the appropriate authorization to access that table.

When you concatenate a user ID to a table name, you fully qualify the table. That is, owner.table-name uniquely identifies a table in the database. For example, there can never be two SMITH.DEPARTMENT tables in the database at the same time.

Use fully qualified object names until you are an experienced DB2 Server for VSE & VM user. By fully qualifying database object names, you avoid confusion and errors.

Using Special Characters and Blanks within Identifiers

An identifier can contain blanks (but must not begin or end with blanks) or special symbols if you enclose them in double quotation marks. For example:

"RESEARCH EMPLOYEES"

You should not, however, use double quotation marks within an SQL identifier. The following is not a valid identifier:

"EMP"13"TABLE"


[ Top of Page | Previous Page | Next Page | Table of Contents | Index ]