Importing Stored Procedures
CONNX automatically imports stored procedures during the CONNX table/view import process.
CONNX can import stored procedures from any DRDA-compliant target, including DB2 UDB 5.x and 6.x for Windows/Linux, DB2/400, and DB2 for MVS/OS/390. On supported platforms, CONNX can import stored procedures with input, output, and input/output parameters, as well as stored procedures which return multiple result sets. Stored procedures can be implemented in a variety of high-level languages, including Java, C/C++, Cobol, RPG, and DB2/400 Command Language. The CONNX user does not need to know the implementation details. As long as a stored procedure is defined to the target DB2 system metadata catalog via the Create Procedure SQL statement, CONNX can find and import it.
Once imported to the CDD, the DB2 stored procedure properties are displayed in a tabbed dialog format similar to imported tables or views.
An ODBC application can invoke a DB2 stored procedure via CONNX with the following syntax:
?={call rdbname.schema.procname(?,?,...?)}
or
?={call schema.procname(?,?,...?)}
or
?={call procname(?,?,...?)}
where the left question mark (?) is an optional return parameter, and the parameters within parentheses are input/output parameters defined by the ODBC 2.x/3.x SQLBindParameter API calls. DB2 stored procedure result set attributes are not imported; these attributes are determined at runtime.