ODBC Server Reference Manual

CORE SQL Language
HP NonStop ODBC Server Reference Manual429151-002
3-48
DROP TABLE
DROP TABLE
Use DROP TABLE to remove a table from a database, along with all data, indexes,
and dependent views for that table.
The DROP TABLE statement has the following syntax:
base-table-name
specifies the table to be dropped. The table name can be qualified with the
database name and owner name.
DROP TABLE also drops any indexes based on the base table.
CASCADE
specifies that constraints and viewed tables that reference the base table are also
dropped. CASCADE is the default specification.
RESTRICT
is not supported. The setting of the SQL_UNSUPPORTED flag in the ZNSPROF
mapping table determines whether the NonStop ODBC Server reports an error, issues
a warning message, or ignores the RESTRICT parameter.
Example
The following statement drops the EMPLOYEE table from the database:
drop table employee
The DROP TABLE statement also drops any constraints, indexes, and views that
reference the EMPLOYEE table.
Dropping Dependent Views and Indexes
You should drop dependent views and indexes before dropping a table using the
NonStop ODBC Server.
When you drop a table using the NonStop ODBC Server, NonStop SQL/MP drops the
table and all dependent views and indexes. The NonStop ODBC Server, however,
does not clear the mapping table entries for the views or indexes.
DROP TABLE base-table-name
[ CASCADE | RESTRICT ]
Note. When the mapping table entries are not cleared and you later attempt to create a view
or index by the same name, you will receive error messages saying that the object already
exists when in fact it does not.