Creating multiple versions of external procedures

For native SQL procedures, you can use Db2 to create and maintain multiple versions of the procedure. However, for external procedures including external SQL procedures, if you need multiple versions of a procedure, you need to maintain them manually.

Before you begin

Deprecated function: External SQL procedures are deprecated and not as fully supported as native SQL procedures. For best results, create native SQL procedures instead. For more information, see Creating native SQL procedures and Migrating an external SQL procedure to a native SQL procedure.

Procedure

To create multiple versions of external procedures, including external SQL procedures, use one of the following techniques:

  • Define multiple procedures with the same name in different schemas. You can subsequently use the SQL path to determine which version of the procedure is to be used by a calling program.
  • Define multiple versions of the executable code. You can subsequently use a particular version by specifying the name of the load module for the version that you want to use on the EXTERNAL clause of the CREATE PROCEDURE statement or ALTER PROCEDURE statement.
  • Define multiple packages for a procedure. You can subsequently use the COLLID option, the CURRENT PACKAGESET special register, or the CURRENT PACKAGE PATH special register to specify which version of the procedure is to be used by the calling application.
  • Set up multiple WLM environments to use different versions of a procedure.