This statement is an extension to the ANSI/ISO standard for SQL.
>>-RENAME DATABASE--+--------+----------------------------------> '-owner.-' >--old_database--TO--new_database------------------------------><
Element | Description | Restrictions | Syntax |
---|---|---|---|
new_database | New name that you declare here for old_database | Must be unique among database names of the current database server; must not be opened by any user when this statement is issued | Database Name, p. Database Name |
old_database | Name that new_database replaces | Must exist on current database server, but it cannot be the name of the current database | Database Name, p. Database Name |
owner | Owner of old_database | Must be the owner of the database | Owner, p. Owner Name |
You can rename a database if either of the following is true:
The RENAME DATABASE statement fails with error -9874, however, if the specified database contains a virtual table or a virtual index.
You can only rename databases of the database server to which you are currently connected.
You cannot rename a database from inside an SPL routine.
Related statement: CREATE DATABASE
For information on how to update the three-part names of JAR files after you rename the database, see the J/Foundation Developer's Guide.