ODBC Server Reference Manual
Transact-SQL Language
HP NonStop ODBC Server Reference Manual—429151-002
4-65
DROP DATABASE
DROP DATABASE
Use DROP DATABASE to remove one or more NonStop SQL/MP catalogs.
DROP DATABASE removes the NonStop ODBC Server mapping tables and the
NonStop SQL/MP catalog.
The DROP DATABASE statement has the following syntax:
database-name
is the subvolume name that identifies the database.
The database-name is a subvolume optionally qualified with a node and volume.
If you omit the node and volume, the database-name is expanded using the
user’s current node and volume.
Examples
The following statement drops the database PERSNL:
drop database persnl
The database is in the user’s current node and volume. For example, if the user’s
current node and volume is \RELY.$DISK01, the catalog PERSNL must be in
\RELY.$DISK01.PERSNL.
The following statement drops three databases, PERSNL, SALES, and INVENT:
drop database persnl, sales, invent
All three of these databases must be in the user’s current node and volume.
How the NonStop ODBC Server Drops Database Objects
When an object is registered in a customized catalog, the NonStop ODBC Server
mapping tables keep track of whether the object was created using the NonStop ODBC
Server or using NonStop SQL/MP.
When you drop a database using the NonStop ODBC Server, the NonStop SQL/MP
catalog is dropped only if all objects in it were created through the NonStop ODBC
Server. When you drop a mapped table, view, or index, the underlying NonStop
SQL/MP object is also dropped and its mapping table removed.
DROP DATABASE fails if the mapping tables contain any NonStop ODBC Server
objects that cannot be dropped.
DROP DATABASE database-name [ , database-name ] ...
Note. If you execute a DROP DATABASE statement that names the database you are
currently using, you must execute a USE statement specifying that database before attempting
any SQL operations. Otherwise, you might receive unexpected results.