Generic method requests for Db2®
The File Manager Service Provider accepts the following JSON for generic method requests for access to Db2® data.
{
"resource" :
{
"ssid" : "string",
"owner" : "string",
"tableName" : "string",
"dataCcsid" : integer,
"dbcsCcsid" : integer
},
"template" :
{
"templateName" : "string",
"tmplCcsid" : integer
},
"operation" :
{
"numRows" : integer,
"session" : Boolean,
"token" : "string",
"timeout" : integer,
"where" : "string",
"maxRows" : integer
},
"position" :
{
"row" : integer
}
}
Key fields for generic method requests are explained in the following table.
Note: Parameters flagged as (Required) are only required for an initial request.
Key | Description |
---|---|
resource | (Required) Parameters associated with the Db2® data resource. Resource parameters are only required when performing a single or initial read from a data resource. Resource parameters are not required on subsequent read requests when a token is passed. |
ssid | (Required) The Db2® subsystem identifier. |
owner | (Required) The name of the Db2® table owner. |
tableName | (Required) The name of the Db2® table. |
dataCcsid | CCSID of resource alphanumeric data. Default is 037. |
dbcsCcsid | CCSID of graphic or double-byte data. Default is 930. This could be the same as dataCcsid and is needed to support GRAPHIC and DBCS fields. |
template | Template parameters map the Db2® database rows. Template parameters are only required when performing a single or initial read from a Db2® resource. Template parameters are not required on subsequent read requests when a token is passed. |
templateName | Name of a File Manager/Db2 template. Example: MVS.DATASET(MYTMPL). |
tmplCcsid | CCSID of the template. Default is 037. |
operation | Operation parameters affect the behavior of the service provider. All operation parameters are optional, but for performance reasons it is helpful to understand the correct use of the session and token parameters. |
numRows | The number of table rows to retrieve. The acceptable range is 0 - 10000. The default is 1. |
session | Indicates whether to persist or end a File Manager/Db2 session. A value of true instructs the service provider to start the session (if it is not already started) and keep it active for subsequent API calls. A value of false instructs the service provider to end the session when the API call is complete. |
token | A session token, as returned in a previous API response. The token represents an active FM/Db2 session and can be used for subsequent reads following an
initial read that sets "session" : true . A successful initial read request with
"session" : true returns a token in the response. |
timeout | Time in seconds for which the FM/Db2 view session can be
inactive before it is terminated. Can be any value from 0 to 28800 (eight hours). The default is 300
(5 minutes). If the value is greater than the max_timeout in the server.xml configuration, the timeout value is ignored and the max_timeout value is used instead. |
where | A valid Db2® WHERE clause that applies to the Db2® data resource on the initial API request when the Db2® session is started. The where clause can affect the result table for the session. This parameter is only valid on an initial API request, and is mutually exclusive with token. |
maxRows | The maximum number of rows in the result table for the Db2® session. A value of 0 requests all rows without a maximum. Note: Reading all rows in a
large table or expected result table may take a long time. maxRows is mutually exclusive with token. The default is 10000. |
position | Position parameters affect the read position within the Db2® data resource. If requested, the service provider will position to the nominated row in the result table before reading the next rows. The default is 1 for an initial read, or the current row position for a subsequent read. A read is considered a subsequent read if a valid token is passed. |
row | A relative row position within the result table. For an initial request, this can be the starting row for the result set. |