DROP TABLE statement

Use the DROP TABLE statement to remove a table with its associated indexes and data. This statement is an extension to the ANSI/ISO standard for SQL.

Syntax

Read syntax diagramSkip visual syntax diagram
>>-DROP TABLE--+-----------+--+------------+--+-table---+------->
               '-IF EXISTS-'  '- owner --.-'  '-synonym-'   

   .-CASCADE------.   
>--+-+----------+-+--------------------------------------------><
     '-RESTRICT-'     

Element Description Restrictions Syntax
owner Name of table owner Must own the table Owner name
synonym Local synonym for a table that is to be dropped The synonym and its table must exist, and USETABLENAME must not be set to 1 Identifier
table Name of a table to drop Must be registered in the systables system catalog table of the local database Identifier

Usage

You must be the owner of the table or have the DBA privilege to use the DROP TABLE statement.

If you include the optional IF EXISTS keywords, the database server takes no action (rather than sending an exception to the application) if no table of the specified name is registered in the current database.

You cannot drop a system catalog table.

If you issue a DROP TABLE statement, DB-Access does not prompt you to verify that you want to delete an entire table.


Copyright© 2019 HCL Technologies Limited