Online Documentation for SQL Manager for DB2

Packages


The Package is an encapsulated collection of related routines stored together in the database as a control structure that is used to execute SQL statements.

 

 

Creating Packages

 

To create a new package:

Hint: To create a new package, you can also right-click the Packages node of the DB Explorer tree and select the New Package... context menu item.

 

To create a new package with the same properties as one of existing packages has:

Alternatively, you can right-click a package in the DB Explorer tree and select the Duplicate Package <package_name>... context menu item.

 

Duplicate Object Wizard allows you to select the database to create a new package in, and to edit the result SQL statement for creating the package.

 

 

Editing Packages

 

To edit an existing package:

  • select the package for editing in the DB Explorer tree (type the first letters of the package name for quick search);
  • right-click the object and select the Edit Package <package_name>... context menu item, or simply double-click the package;
  • edit package definition using the appropriate tabs of Package Editor.

 

Dropping Packages

 

To drop a package:

  • select the package to drop in the DB Explorer tree;
  • right-click the object and select the Drop Package <package_name>... context menu item;
  • confirm dropping in the dialog window.

 

Note: If more convenient, you can also use the following shortcuts:

Ctrl+N to create a new package;

Ctrl+O to edit the selected package;

Shift+Del to drop the object from the database.