Restrictions that apply to all external routines:
New threads cannot be created in external routines.
Connection level APIs cannot be called from within external functions or external methods.
Receiving inputs from the keyboard and displaying outputs to standard output is not possible from external routines. Do not use standard input-output streams. For example:
In external Java™ routine code, do not issue the System.out.println() methods.
In external C or C++ routine code, do not issue printf().
In external COBOL routine code, do not issue display
Although external routines cannot display data to standard output, they can include code that writes data to a file on the database server file system.
Note: DB2® does not attempt to synchronize any external input or output performed by a routine with DB2's own transactions. So, for example, if a UDF writes to a file during a transaction, and that transaction is later backed out for some reason, no attempt is made to discover or undo the writes to the file.
Connection-related statements or commands cannot be executed in external routines. This restriction applies to the following statements, including:
Operating system function usage within routines is not recommended.
External routines must not contain commands that would terminate the current process. An external routine must always return control to the DB2 database manager without terminating the current process.