Previous Topic: DROPNext Topic: Example 1


Description

authid.

An optional identifier of the schema for the table, view, or index. If specified for the index-name, it must be the same as the authorization ID of the table you have specified with the tab-name in the FROM tab-name clause. Use a period (.) to concatenate the authorization ID to the table or view name, for example, authid.tab-name.

TABLE

Indicates that the object you are dropping is a table.

tab-name

Specify the name of the table you want to drop. The tab-name must identify a table described in the CA Datacom Datadictionary, other than a CA Datacom Datadictionary table.

The DROP TABLE statement removes the table from the schema, obsoletes the table from the CA Datacom Datadictionary, and removes the table from the CA Datacom/DB Directory (CXX).

Important! The table data is deleted and the space is reclaimed when you drop a table.

All views and synonyms based on the table are dropped. All application plans and statements that reference the table are invalidated. If the table definition exists in TEST or HIST status in CA Datacom Datadictionary, those status/versions are deleted at the same time as the PROD status.

All columns (columns appear as FIELD occurrences in CA Datacom Datadictionary ), keys, elements, and support data related to the table are also obsoleted. The support data includes aliases, descriptors, relationship definitions, and text (SQL comments).

SYNONYM

Indicates that the object you are dropping is a synonym.

synonym-name

Specify the name of the synonym you want to drop. Dropping a synonym does not affect the table or view referenced by the dropped synonym.

VIEW

Indicates that the object you are dropping is a view.

view-name

Specify the name of the view you want to drop. The view name must identify a view described in the CA Datacom Datadictionary. The definition of the view is removed from the CA Datacom Datadictionary. The definition of any view that is directly or indirectly dependent on that view is also removed. When the definition of a view is removed from the CA Datacom Datadictionary, all privileges on that view are also dropped.

INDEX

Indicates that the object you are dropping is an index.

index-name FROM tab-name

Specify the name of the index you want to drop and the table to which the index belongs. Make certain that the index-name you use in the DROP INDEX statement matches the SQLNAME attribute of the KEY that you wish to DROP.

Dropping an index removes the index from the Index Area (IXX), removes the index definition from the Directory (CXX) and CA Datacom Datadictionary, and causes all plans dependent on the indexed table to be marked invalid. You can run a CA Datacom Datadictionary Relationship Report to find out what plans are dependent on a table. See the CA Datacom Datadictionary Batch Reference Guide for information on Relationship Reports.

SPECIFIC

Provided for ANSI syntax compatibility only. Specifies that the proc-name given is the specific name of the procedure.

PROCEDURE

DROP PROCEDURE deletes a procedure definition and the associated program definition and plan (that is, the portion of the procedure logic that resides in SQL).

Note: For an overview and examples of procedures and triggers, see Procedures and Triggers.

proc-name

Specify a procedure name.

ANSI supports overloading of the procedure name, with duplicate procedure names resolved to procedure definitions using the layout of the parameter list. For syntax compatibility purposes, a second, specific name may be given to a procedure to uniquely identify it, but it must match the nonspecific name, and the nonspecific name must be unique.

RESTRICT

Tells SQL to abort the DROP if triggers exist that call the procedure. RESTRICT is the default.

INVALIDATE

Specifies that referencing triggers are marked invalid, and therefore cannot execute until the procedure is re-added and the triggers rebound. The rebind occurs automatically and is transparent to the user unless the procedure has not been replaced when the triggering of the trigger occurs. This option protects the integrity of the tables on which the triggers are defined. Any attempt to fire an invalid trigger causes the triggering maintenance request (INSERT, UPDATE, or DELETE) to abort, unless the automatic trigger rebind succeeds. The INVALIDATE option also causes the plan related to the procedure to be marked invalid. The plan automatically rebinds during the next CALL PROCEDURE if the procedure is re-created.

CASCADE

Specifies the dropping of any referencing triggers. In order to avoid the potential for later PROGRAM/PLAN MISMATCH errors if the procedure is re-precompiled, unless the program is called by other procedures we strongly recommend that you delete the corresponding load module and CA Datacom Datadictionary PROGRAM definitions at this time. The LOAD module and CA Datacom Datadictionary PROGRAM definitions are not affected.

DROP TRIGGER/RULE

Specify either a TRIGGER or RULE to be dropped. DROP TRIGGER/RULE deletes a trigger or rule from the system. To prevent a trigger from being invoked after being dropped, plans containing SQL statements that reference the table from which the trigger is being removed are marked invalid and automatically rebound the next time they are executed.

Note: For an overview and examples of procedures and triggers, see Procedures and Triggers.

trig-name

Specify a trigger name.