Displaying parameter information and calling federated procedures
Query the SYSCAT.ROUTINESFEDERATED catalog view to display parameter information. Then use the CALL statement to call a federated procedure.
Before you begin
The user who calls a federated procedure must have EXECUTE privilege on the data source and a valid user mapping to a remote data source user ID that has the privilege to access the data source tables.
Procedure
To display parameter information and call a federated procedure,
use one of these methods:
- Use the SELECT statement to query the SYSCAT.ROUTINEPARMS view in the federated database catalog.
- Issue a CALL statement.
This example uses a SELECT statement to obtain information
about the federated procedure. For example, if the federated procedure
FEDPROC1 is in the federated schema BOB, issue this SELECT statement:
SELECT ordinal, char(parmname,30)
AS name,
rowtype, char(typename,30) AS type
FROM syscat.routineparms
WHERE routinename='FEDPROC1' AND
routineschema = 'BOB'
ORDER BY ordinal;The result of the query lists the parameters:
ORDINAL NAME ROWTYPE TYPE
------- ---- ------- --------
1 P1 P INTEGER
2 P2 O VARCHARThe P row type indicates an input parameter. The O row type indicates an output parameter. Not shown in this example is a B row type that indicates an INOUT parameter.