DROP TABLE

The DROP TABLE statement removes an existing table from a database in IMS. Any resources that are directly or indirectly dependent on that table are deleted. Whenever a table is deleted, its description is deleted from the catalog at the current IMS.

Invocation

This statement can be submitted from a Java™ application program with an establish connection to IMS through the IMS Universal JDBC drivers. It is an executable statement that cannot be dynamically prepared.

Syntax

Read syntax diagramSkip visual syntax diagramDROPTABLEtable_name INdatabase_name

Description

The following keyword parameters are defined for the DROP TABLE statement:
TABLE table_name
Identifies the 1- to 128-character uppercase alphanumeric name of the table to drop. A table name can include the underscore character. The name must identify a table that exists in IMS. When a table is dropped, all tables defined as its children are also dropped.
IN database_name
Specifies the DBD name of a database where the table is defined. Specifying a DROP TABLE indicated that the table will be removed from the database. This triggers an alteration of this database.

Usage notes

When a table is directly or indirectly dropped, the following items are also dropped:
  • All of the privileges associated with the table.
  • All of the tables defined as children that are associated with the table being dropped through use of the FOREIGN KEY clause.

Example

Assuming you have already created a table with the following example (see CREATE TABLE), and you now want to drop the table:

DROP TABLE testinteger IN COGDBD