Hitachi

Hitachi Advanced Database SQL Reference


6.10.2 What to do when a name conflicts with a reserved word

Shown below are two ways to respond when a naming conflict with a reserved word arises.

Basically, changing the SQL statement to enclose the name in double quotation marks (") is the recommended method. Unregistering the reserved word is only for cases in which changing the SQL statement would be too difficult; for example, when the amount of work would be too great.

Organization of this subsection

(1) Enclosing the name in double quotation marks

Enclose the character string that is the same as a reserved word in double quotation marks ("). If you enclose the reserved word in double quotation marks ("), you can use it in SQL statements in the same way as any other string.

(2) Unregistering a duplicated reserved word

By unregistering a reserved word, you will be able to use it as a name without having to enclose it in double quotation marks ("). Note, however, that there are reserved words that cannot be unregistered. For the reserved words that cannot be unregistered, see 6.10.1 List of reserved words.

Important

If you delete a reserved word, you can no longer execute any SQL statements that include the deleted reserved word.

If you delete reserved words after defining a table, the reserved words remain valid in the definition. Therefore, doing so might cause an error to occur when the table is redefined.

To unregister a reserved word, specify it in the adb_sql_prep_delrsvd_words operand in the server definition. For details about the adb_sql_prep_delrsvd_words operand, see Operands related to SQL statements (set format) in Detailed descriptions of the server definition operands under Designing the Server Definition in the HADB Setup and Operation Guide.

If you want to prevent an application from actually unregistering any reserved words specified in the adb_sql_prep_delrsvd_words operand in the server definition, specify N for the client definition's adb_sql_prep_delrsvd_use_srvdef operand. For details about the adb_sql_prep_delrsvd_use_srvdef operand, see Operands related to SQL in Contents of operands in the client definition in Designing Client Definitions in the HADB Application Development Guide.

When you unregister a reserved word using the adb_sql_prep_delrsvd_words operand in the server definition, the effects extend even to the authorization identifiers used to connect to the HADB server. For example, if you specify ABS in the operand adb_sql_prep_delrsvd_words, you can then specify ABS to the -u option of the adbsql command to connect to the HADB server using the authorization identifier ABS.