8. SQL Statements : DROP : Syntax
 
Share this page                  
Syntax
The DROP statement has the following format:
[EXEC SQL] DROP [object_type] [IF EXISTS] [schema.]object_name {, [schema.]object_name} [RESTRICT | CASCADE];
object_type
Specifies the type of object to drop, which can be one of the following keywords:
TABLE
VIEW
INDEX
The following object types can also be dropped. These DROP statements are described under separate entries in this chapter:
DBEVENT (see DROP DBEVENT)
GROUP (see DROP GROUP)
INTEGRITY (see DROP INTEGRITY)
LINK (Applies to Ingres Star only. See the Ingres Star User Guide.)
LOCATION (see DROP LOCATION)
PROCEDURE
PROFILE (see DROP PROFILE)
ROLE (see DROP ROLE)
RULE (see DROP RULE)
SCHEMA (see DROP SCHEMA)
SECURITY_ALARM (see DROP SECURITY_ALARM)
SEQUENCE (see DROP SEQUENCE)
SYNONYM (see DROP SYNONYM)
USER (see DROP USER)
IF EXISTS
Suppresses error reporting for the specified object if the object does not exist or exists but is not owned by you. The IF EXISTS option can be used only for object types TABLE, VIEW, INDEX, SYNONYM, PROCEDURE, LINK.
object_name
Specifies the name of a table, view, index, or other valid object.
RESTRICT
Aborts the DROP statement with error if any objects (views, procedures, synonyms, or referential constraints) depend on the object being dropped.
This is the default for INDEX.
CASCADE
Drops all dependent objects. This is the default for TABLE and VIEW.