Define an external function

If you want to call a program as a function from an SQL program, you must first define the program as an external function. The program for which a function is defined does not need to exist at the time the function is defined.

In order to define a program as an external function:

  1. In the System i Navigator window, expand the system you want to use.
  2. Expand Databases.
  3. Expand the database and schema that you want to work with.
  4. Right-click the Functions container and select New, then External.

To define your external function on the New External Function dialog, use the following steps for the tabs.

General
Parameters
External Program