An external stored procedure is defined with a CREATE PROCEDURE or REPLACE PROCEDURE statement, along with EXTERNAL references for source files.
CREATE PROCEDURE xyz (IN data1 INTEGER, OUT data2 INTEGER) LANGUAGE CPP NO SQL PARAMETER STYLE TD_GENERAL EXTERNAL NAME 'CS!xyz!source.cpp';
The C or C++ files can reside on the server or the client. The server calls for the transfer of client-resident files as needed to satisfy input requirements for the CREATE PROCEDURE or REPLACE PROCEDURE request. Source files must be encoded as ASCII (workstation) or EBCDIC (mainframe), regardless of the current session character set. See SQL External Routine Programming (B035-1147) for more information.
The retrieval of client-resident external stored procedure files is handled the same way that User-Defined Function files are handled. See Specifying Files for User-Defined Functions.