1.1.7 Specification of names

A name can be specified by either enclosing it in double quotation marks (") or not enclosing it.

Reference note
For specifying a name, Hitachi recommends enclosing it in double quotation marks ("). If a name containing alphabetic characters is enclosed in double quotation marks ("), the alphabetic characters will be case sensitive.
Reasons
A name must be distinct from any of the reserved words. However, a name enclosed in double quotation marks (") can be identical to a reserved word. Because, as the SQL is expanded, additional reserved words may be registered in the system, the potential problem of conflict with newly added reserved words can be avoided by enclosing names in double quotation marks (").

However, except for a cursor name specified within a process or function, if you use the following names in a UAP, specify them without enclosing them in double quotation marks (").

Organization of this subsection
(1) Common rules
(2) What to do if a name conflicts with an SQL reserved word

(1) Common rules

Table 1-2 Characters in names and maximum numbers of characters

Type of nameMax number of bytes or charsSingle-byte charactersDouble-byte chars
UC, numericLCKanaUnderscore (_)SpaceHyphen
(-)
Index-type identifier30 bytesYYY#2YYYY#2
Index identifierYYY#2YYYY#2
Embedded variable name21 characters, 22 characters, 30 characters, 31 characters, 63 characters#1Y#4YY#4YNY#4Y#4
Cursor name30 bytesYYY#2YNYY#2
External routine name255 bytesYYY#2YNNY#2
Condition name30 bytesYYY#2YYYY#2
Correlation nameYYY#2YYYY#2
Attribute nameYYY#2YYYY#2
Data type identifierYYY#2YYYY#2
Query nameYYY#2YYYY#2
Trigger identifierYYY#2YYYY#2
Authorization identifier8 bytesYYNNNNN
Password#330 bytesYYNNNNN
Table identifierYYY#2YYYY#2
Indicator variable name30 characters, 31 characters, 63 characters#1Y#4YY#4YNY#4Y#4
Statement label30 bytesYYY#2YYYY#2
Loop variable nameYYY#2YYYY#2
Host identifier30 characters, 31 characters, 63 characters#1Y#4YY#4YNY#4Y#4
List name30 bytesYYY#2YYYY#2
Routine identifierYYY#2YYYY#2
Column nameYYY#2YYYY#2
RDAREA nameYYNYYYY#2
SQL parameter nameYYY#2YYYY#2
SQL statement identifierYYY#2YNYY#2
SQL variable nameYYY#2YYYY#2
Constraint nameYYY#2YYYY#2
XQuery variable identifierYYY#2YYYY#2
Sequence generator identifierYYY#2YYYY#2
DBAREA nameYYNYNYN

UC: Upper-case characters

LC: Lower-case characters

Y: Can be used.

N: Cannot be used.

#1: The lengths of embedded variable names, indicator variable names, and host identifiers are as follows:

Type of nameHost language
COBOL85COBOL2002C language
Embedded variable nameBLOB type21 characters maximum22 characters maximum63 characters maximum
Non-BLOB type30 characters maximum31 characters maximum
Indicator variable name or host identifier

For COBOL85 and COBOL2002, double-byte characters count as one character. For the C language, universal character names count as one character.

#2: Restricted by the type of character code used. Do not use if you specified utf-8 or chinese-gb18030 as the character code classification with the pdntenv command (pdsetup command in the UNIX edition).

#3: The following rules apply to passwords:
  • A password must begin with an alphabetic character.
  • A password cannot consist of numeric characters only.
  • It is possible to require that a password not consist of only upper-case letters or only lower-case letters.
#4
  • COBOL85 and COBOL2002:
    Embedded variable names, indicator variable names, and host identifiers can include a to z, A to Z, 0 to 9, underscores (_), hyphens (-), half-width katakana, and double-byte characters.
    You can mix single-byte and double-byte characters.
  • C language:
    Embedded variable names, indicator variable names, and host identifiers can include a to z, A to Z, 0 to 9, and underscores (_).
    You can specify universal character names (\uxxxx and \Uxxxxxxxx) if the compiler supports them.
    Multi-byte characters are not allowed.

(2) What to do if a name conflicts with an SQL reserved word

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.

(a) Revising the SQL

Revise the SQL so that the name that is in conflict with a reserved word is enclosed in double quotation marks ("). Note that if a name containing alphabetic characters is enclosed in double quotation marks ("), the alphabetic characters will be case sensitive.

(b) Using the SQL reserved word deletion facility

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 double 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.

Usage method
SQL reserved word deletion files for which the reserved words to be deleted using the SQL reserved word deletion facility must be specified in advance in the system common definition pd_delete_reserved_word_file operand. For the system common definition pd_delete_reserved_word_file operand, see the manual HiRDB Version 9 System Definition.
When using the SQL reserved word deletion facility, you need to specify the SQL reserved word definition file to be used, by means of the client environment variable PDDELRSVWDFILE. For the client environment variable PDDELRSVWDFILE, see the HiRDB Version 9 UAP Development Guide.
Notes
  1. When executing an SQL that recreates an SQL object, in the client environment variable PDDELRSVWDFILE, specify the reserved word deletion file that was specified at the time of the definition of the object.
  2. When importing or exporting a table using the dictionary import/export utility (pdexp), in the client environment variable PDDELRSVWDFILE, specify the reserved word deletion file that was specified at the time of the definition of the table. Also, ensure that the following items match between the export source and import destination directories:
    [Figure]All files under %PDDIR%\conf\pdrsvwd
    [Figure] Values specified in the system common definition pd_delete_reserved_word_file operand