A name can be specified by either enclosing it in quotation marks (") or not enclosing it.
If any of the following names is used in a UAP, other than a cursor name specified in a procedure or a function, it should be specified without enclosing it in quotation marks ("), even if it is identical to an SQL reserved word:
Table 1-2 Characters in names and maximum numbers of characters
Type of name | Max number of bytes or chars | Single-byte characters | Double-byte chars | |||||
---|---|---|---|---|---|---|---|---|
UC, numeric | LC | Kana | Underline (_) | Space | Hyphen (-) | |||
Index-type identifier | 30 bytes | Y | Y | Y2 | Y | Y | Y | Y2 |
Index identifier | Y | Y | Y2 | Y | Y | Y | Y2 | |
Embedded variable name1 | 30 characters | Y | Y | Y2 | Y | N | Y | Y2 |
Cursor name | 30 bytes | Y | Y | Y2 | Y | N | Y | Y2 |
Foreign server name | Y | Y | N | Y | Y | Y | N | |
External routine name1 | 255 bytes | Y | Y | Y2 | Y | N | N | Y2 |
Condition name | 30 bytes | Y | Y | Y2 | Y | Y | Y | Y2 |
Correlation name | Y | Y | Y2 | Y | Y | Y | Y2 | |
Attribute name | Y | Y | Y2 | Y | Y | Y | Y2 | |
Data type identifier | Y | Y | Y2 | Y | Y | Y | Y2 | |
Query name | Y | Y | Y2 | Y | Y | Y | Y2 | |
Trigger identifier | Y | Y | Y2 | Y | Y | Y | Y2 | |
Authorization identifier | 8 bytes | Y | Y | N | N | N | N | N |
Password3 | 30 bytes | Y | Y | N | N | N | N | N |
Table identifier | Y | Y | Y2 | Y | Y | Y | Y2 | |
Indicator variable name1 | 30 characters | Y | Y | Y2 | Y | N | Y | Y2 |
Table alias | 30 bytes | Y | Y | Y2 | Y | Y | Y | Y2 |
Statement label | Y | Y | Y2 | Y | Y | Y | Y2 | |
Loop variable name | Y | Y | Y2 | Y | Y | Y | Y2 | |
Host identifier1 | Y | Y | Y2 | Y | N | Y | Y2 | |
List name | Y | Y | Y2 | Y | Y | Y | Y2 | |
Routine identifier | Y | Y | Y2 | Y | Y | Y | Y2 | |
Column name | Y | Y | Y2 | Y | Y | Y | Y2 | |
Role name | Y | Y | N | N | N | N | N | |
RDAREA name | Y | Y | N | Y | Y | Y | Y2 | |
RD-node name | Y | Y | N | N | N | N | N | |
SQL parameter name | Y | Y | Y2 | Y | Y | Y | Y2 | |
SQL statement identifier | Y | Y | Y2 | Y | N | Y | Y2 | |
SQL variable name | Y | Y | Y2 | Y | Y | Y | Y2 | |
Constraint name | Y | Y | Y2 | Y | Y | Y | Y2 |
UC: Uppercase characters
LC: Lowercase characters
Y: Can be used.
N: Cannot be used.
1 Specification of these names is subject to restrictions by the host language.
COBOL 85 and COBOL 2002 permit a mix of double-byte characters and single-byte characters in embedded variable names, indicator variable names, host identifiers, and external routine names. The allowable length of an embedded variable, external routine name, or indicator variable, regardless of whether it is in single- or double-byte characters, is 30 characters for COBOL 85 and 31 characters for COBOL 2002.
2 Restricted by the type of character code used. This character code should not be used when the character code type utf-8 is specified in the pdsetup command (pdntenv in Windows).
The following text shows what to do when a specified name conflicts with an SQL reserved word. Hitachi recommends the method described in (a). Method (b) should be used when the SQL cannot be revised, including the situation in which an application cannot be modified.
Revise the SQL so that the name that is in conflict with a reserved word is enclosed in quotation marks ("). Note that if a name containing alphabetic characters is enclosed in quotation marks ("), the alphabetic characters will be case sensitive.
The SQL reserved word deletion facility provides a facility for deleting keywords registered as SQL reserved words from the list of reserved words. If the reserved word that is in conflict with a specified name can be deleted using the SQL reserved word deletion facility, by deleting it from the list of reserved words, you can use the specified name without enclosing it in quotation marks ("). For a list of reserved words that can be deleted using the SQL reserved word deletion facility, see A.3 Reserved words that can be deleted using the SQL reserved word deletion facility. For reserved words that cannot be deleted by the SQL reserved word deletion facility, revise the SQL using method (a).
Although a deleted reserved word can be used as a name, it is no longer a keyword. Consequently, the SQL facility that uses the deleted reserved word may cease to function properly. For SQL facilities that lose their functionality in this manner, see A.3 Reserved words that can be deleted using the SQL reserved word deletion facility.