A system, method, and program product are provided that identifies a
remote stored procedure stored in a remote database management system,
and automatically generates a local stored procedure stored in a local
database management system. To automatically generate the local stored
procedure, local and remote metadata are gathered corresponding,
respectively, to a local database management system and a remote database
management system. The remote metadata is used to create a call statement
to the remote stored procedure. The created invocation method maps input
values, input to the local stored procedure, to input parameters of the
remote stored procedure. Results in the local stored procedure are set by
mapping the data returned from the remote stored procedure to the
corresponding return values (e.g., parameters and result sets) in the
local stored procedure values.