Describe Routine
describe_routineInspect DB2 for i SQL procedures and functions to get parameters, return values, result columns, and a ready-to-use call template.
Instructions
Describe an SQL procedure or function from QSYS2.SYSPARMS: parameters in order with mode, data type, and default; the return value of a scalar function; and the result columns of a table function. An overloaded name returns every overload unless specific_name picks one. call_template is a statement with a ? marker per parameter. callable_with_execute_query says whether execute_query can run it: procedures (CALL) and functions that modify SQL data cannot, and note says why. Uses the system's default schema if not provided.
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "describe_routine"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | No | Routine name. Required unless specific_name is given. | |
| schema | No | Schema (library) containing the routine. Uses the system's default schema if not provided. | |
| specific_name | No | Specific name of one overload, from list_routines. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| data | No | ||
| cause | No | Why the statement failed. &1-style placeholders stand for values in error. | |
| count | No | ||
| error | No | ||
| schema | No | ||
| sqlcode | No | SQLCODE of the failed statement, such as -204 | |
| success | Yes | ||
| recovery | No | What to change before trying again | |
| sqlstate | No | SQLSTATE of the failed statement | |
| truncated | No |