Defining multiple SQL language handlers

To send SQL language requests to more than one language RPC (that is, if you have copies of the Mainframe Connect DB2 UDB Option for CICS and IMS in other regions), define multiple language handlers, each with a different RPC name and a different region name. Clients can explicitly specify the particular language RPC in the request.

Add the alternate language handlers using the sgw_addrpc procedure, using the following parameter values:

This isql example shows three procedures that define different RPCs for the AMD2 transactions at the DALLAS, DETROIT, and MIAMI regions, respectively. This example allows a user to specify the region to which TRS sends the language request: “DALLASrpc” uses the DALLAS region, “DETROITrpc” uses the DETROIT region, and “MIAMIrpc” uses the MIAMI region.

exec sgw_addrpc DALLASrpc, AMD2, DALLAS, both
 go
exec sgw_addrpc DETROITrpc, AMD2, DETROIT, both
 go
exec sgw_addrpc MIAMIrpc, AMD2, MIAMI, both
 go

If security is enforced, add the preceding RPCs to the appropriate tran_group that the tran_group users can access:

exec sgw_addrpctogrp TRANGRP2, DALLASrpc, user
go
exec sgw_addrpctogrp TRANGRP2, DETROITrpc, user
go
exec sgw_addrpctogrp TRANGRP2, MIAMIrpc, user
go

To obtain results from “TESTREGG” with SYRT as the default (using the “Example”), a user invokes a SQL query program, such as isql, and enters a query similar to this:

select * from payroll
go

To obtain results from MIAMI, a user enters the execute command, specifying the RPC named “MIAMIrpc”:

exec MIAMIrpc "select * from payroll"
go