List Routines
list_routinesLists SQL procedures and functions in a DB2 for i library, showing type, language, and external program; use it to find routines before describing parameters.
Instructions
List SQL procedures and functions in a library from QSYS2.SYSROUTINES, one row per specific routine, so overloads appear once each. Shows the type (procedure, scalar function, or table function), language, external program, SQL data access, result sets, and text. Use describe_routine for parameters and a call template. Uses the system's default schema if not provided.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| type | No | Only procedures or only functions. Omit for both. | |
| limit | No | Maximum routines to return. Capped by QUERY_MAX_LIMIT. | |
| filter | No | Filter routine names. Use * as wildcard, e.g. "GET*". Without a wildcard, matches names containing the text. | |
| schema | No | Schema (library) to list routines in. Uses the system's default schema if not provided. |
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 |