DB2 10.5 for Linux, UNIX, and Windows

Dropping modules

Dropping modules is a task that can be done when you no longer require any of the objects defined within the module or the module itself.

Before you begin

Before performing this task:

About this task

This topic shows you how to completely drop a module. If only some of the objects in the module are no longer required you can optionally just drop those objects. See: Dropping objects in a module

Restrictions

For restrictions:

Procedure

  1. To drop a module and all of the objects defined in the module, formulate a DROP (Module) statement:
    1. Specify the name of the module to be dropped.
  2. Execute the statement.

Results

If the statement executes successfully, the specified module objects are dropped from the module, the module is dropped from the schema, and all objects dependent on the dropped module objects are invalidated.

Example

Consider a module defined as:
CREATE MODULE m @  

ALTER MODULE m 
  PUBLISH PROCEDURE B() @  

ALTER MODULE m 
  PUBLISH PROCEDURE A() 
            BEGIN  
               CALL B();
            END @  

ALTER MODULE m 
  ADD PROCEDURE B()  BEGIN  END @  
The module and all of the objects defined in the module can be dropped by executing the following statement:
DROP MODULE m @

What to do next

Once you have successfully dropped the module, you might want to modify applications that reference the module, create other modules, or drop other modules.