DB2 10.5 for Linux, UNIX, and Windows

Creating modules

Creating modules is a task that you would perform when you have identified a set of routines, data types, and variables that support a common business need and you want to create them together within a common namespace for easier management and deployment.

Before you begin

To create a module you require:

About this task

Creating modules can be done at any time during database design or modification and can be done from the DB2® Command Line Processor.

Restrictions

For restrictions on this task:

Procedure

  1. Formulate a CREATE MODULE statement:
    1. Specify a name for the module. The name can be qualified by a schema name to specify in what schema the module should be created.
  2. Execute the CREATE MODULE statement.

Results

If the CREATE MODULE statement executes successfully, the module is created in the database.

Example

The following is an example of how to create a module named inventory:
   CREATE MODULE inventory@

What to do next

Once the module is created, you can add data type definitions, cursor definitions, variables, and routine definitions to it by executing the ALTER MODULE statement.