Remote procedure calls (RPCs)

Description

A client application can call a stored procedure on an Adaptive Server or an Open ServerConnect transaction running in a separate CICS or IMS region.

A client application can call a stored procedure or mainframe transaction in one of two ways:

Comparing RPCs and execute statements

RPCs have a few advantages over execute statements:

Remote Procedures executed by servers

A server can execute a stored procedure or transaction residing on another server. This might occur when a stored procedure being executed on one Adaptive Server contains an execute statement for a stored procedure on another Adaptive Server. The execute command causes the first server to log into the second server and execute the remote procedure. This is called a server-to-server RPC. It happens without any intervention from the application, although the application can specify the remote password that the first server uses to log into the second.

A server-to-server RPC also occurs when an application sends a request to execute a stored procedure that does not reside on the server to which it is directly connected.

NoteSQL commands contained in a stored procedure that is executed as the result of a server-to-server remote procedure call cannot be rolled back.

RPC routines

The following functions relate to RPCs:

RPC results

In addition to results generated by the SQL statements they contain, Adaptive Server stored procedures and Open ServerConnect transactions that are executed via an RPC:

All types of results—rows, status, and parameters—can be processed using CTBRESULTS, CTBBIND, and CTBFETCH.