SYSROUTINES

The SYSROUTINES table contains one row for each procedure created by the CREATE PROCEDURE statement and each function created by the CREATE FUNCTION statement.

The following table describes the columns in the SYSROUTINES table:

Table 1. SYSROUTINES table
Column Name System Column Name Data Type Description
SPECIFIC_SCHEMA SPECSCHEMA VARCHAR(128) Schema name of the routine instance.
SPECIFIC_NAME SPECNAME VARCHAR(128) Specific name of the routine instance.
ROUTINE_SCHEMA RTNSCHEMA VARCHAR(128) Name of the SQL schema (schema) that contains the routine.
ROUTINE_NAME RTNNAME VARCHAR(128) Name of the routine.
ROUTINE_TYPE RTNTYPE VARCHAR(9) Type of the routine.
PROCEDURE
This is a procedure.
FUNCTION
This is a function.
ROUTINE_CREATED RTNCREATE TIMESTAMP Identifies the timestamp when the routine was created.
ROUTINE_DEFINER DEFINER VARCHAR(128) Name of the user that defined the routine.
ROUTINE_BODY BODY VARCHAR(8) The type of the routine body:
EXTERNAL
This is an external routine.
SQL
This is an SQL routine.
EXTERNAL_NAME EXTNAME VARCHAR(279)
Nullable
This column identifies the external program name.
  • For SQL functions or ILE service programs, the external program name is schema-name/service-program-name(entry-point-name).
  • For REXX, the external program name is schema-name/source-file-name(member-name).
  • For Java™ programs, the external program name is an optional jar-id followed by a fully-qualified-class-name!method-name or fully-qualified-class-name.method-name.
  • For all other languages, the external program name is schema-name/program-name.

Contains the null value if this is a system-generated function.

EXTERNAL_LANGUAGE LANGUAGE VARCHAR(8)
Nullable
If this is an external routine, this column identifies the external program name.
The external program is written in C.
C++
The external program is written in C++.
CL
The external program is written in CL.
COBOL
The external program is written in COBOL.
COBOLLE
The external program is written in ILE COBOL.
FORTRAN
The external program is written in FORTRAN.
JAVA
The external program is written in JAVA.
PLI
The external program is written in PL/I.
REXX
The external program is a REXX procedure.
RPG 
The external program is written in RPG.
RPGLE
The external program is written in ILE RPG.

Contains the null value if this is not an external routine.

PARAMETER_STYLE PARM_STYLE VARCHAR(7)
Nullable
If this is an external routine, this column identifies the parameter style (calling convention).
DB2GNRL
This is the DB2GENERAL calling convention.
DB2SQL
This is the DB2SQL calling convention.
GENERAL
This is the GENERAL calling convention.
JAVA
This is the JAVA calling convention.
NULLS
This is the GENERAL WITH NULLS calling convention.
SQL
This is the SQL standard calling convention.

Contains the null value if this is not an external routine.

IS_DETERMINISTIC DETERMINE VARCHAR(3) This column identifies whether the routine is deterministic. That is, whether a call to the routine with the same arguments will always return the same result.
NO
The routine is not deterministic.
YES
The routine is Start of changeglobalEnd of changedeterministic.
Start of changeSTMEnd of change
Start of changeThe routine is statement deterministic.End of change
SQL_DATA_ACCESS DATAACCESS VARCHAR(8)
Nullable
This column identifies whether a routine contains SQL and whether it reads or modifies data.
NONE
The routine does not contain any SQL statements.
CONTAINS
The routine contains SQL statements.
READS
The routine possibly reads data from a table or view.
MODIFIES
The routine possibly modifies data in a table or view or issues SQL DDL statements.
SQL_PATH SQL_PATH VARCHAR(3483)
Nullable
If this is an SQL routine, this column identifies the path.

Contains the null value if this is not an SQL routine.

PARM_SIGNATURE SIGNATURE VARCHAR(2048) This column identifies the routine signature.
NUMBER_OF_RESULTS NUMRESULTS SMALLINT Identifies the number of results.
MAX_DYNAMIC_RESULT_SETS RESULTS SMALLINT Identifies the maximum number of result sets returned. 0 indicates that there are no result sets.
IN_PARMS IN_PARMS SMALLINT Identifies the number of input parameters. 0 indicates that there are no input parameters.
OUT_PARMS OUT_PARMS SMALLINT Identifies the number of output parameters. 0 indicates that there are no output parameters.
INOUT_PARMS INOUT_PARM SMALLINT Identifies the number of input/output parameters. 0 indicates that there are no input/output parameters.
PARSE_TREE PARSE_TREE VARCHAR(1024) FOR BIT DATA If this is a routine, this column identifies the parse tree of the CREATE FUNCTION or CREATE PROCEDURE statement. It is only used internally.
PARM_ARRAY PARM_ARRAY BLOB(320000) If this is an external routine, this column identifies the parameter array built from the CREATE FUNCTION or CREATE PROCEDURE statement. It is only used internally.
LONG_COMMENT REMARKS VARGRAPHIC(2000) CCSID 1200
Nullable
A character string supplied with the COMMENT statement.

Contains the null value if there is no long comment.

ROUTINE_DEFINITION ROUTINEDEF DBCLOB(2M)    CCSID 13488
Nullable
If this is an SQL routine, this column contains the SQL routine body.

Start of changeIf this is an obfuscated routine, the text starts with the WRAPPED keyword and is followed by the encoded form of the statement text.End of change

Contains the null value if this is not an SQL routine.

FUNCTION_ORIGIN ORIGIN CHAR(1) Identifies the type of function. If this is a procedure, this column contains a blank.
B
This is a built-in function (defined by Db2® for i).
E
This is a user-defined function.
U
This is a user-defined function that is sourced on another function.
S
This is a system-generated function.
FUNCTION_TYPE TYPE CHAR(1) Identifies the form of the function. If this is a procedure, this column contains a blank.
S
This is a scalar function.
C
This is a column function.
T
This is a table function.
EXTERNAL_ACTION EXTACTION CHAR(1)
Nullable
Identifies whether the invocation of the function has external effects.
E
This function has external side effects.
N
This function does not have any external side effects.

Contains the null value if the routine is a procedure.

IS_NULL_CALL NULL_CALL VARCHAR(3)
Nullable
Identifies whether the function needs to be called if an input parameter is the null value.
NO
This function need not be called if an input parameter is the null value. If this is a scalar function, the result of the function is implicitly null if any of the operands are null. If this is a table function, the result of the function is an empty table if any of the operands are the null value.
YES
This function must be called even if an input operand is null.

Contains the null value if the routine is a procedure.

SCRATCH_PAD SCRATCHPAD INTEGER
Nullable
Identifies whether the address of a static memory area (scratch pad) is passed to the function.
0
The function does not have a scratch pad.
integer
Indicates the size of the scratch pad passed to the function.

Contains the null value if the routine is a procedure.

FINAL_CALL FINAL_CALL VARCHAR(3)
Nullable
Indicates whether a final call to the function should be made to allow the function to clean up its work areas (scratch pads).
NO
No final call is made.
YES
A final call to the function is made when the statement is complete.

Contains the null value if the routine is a procedure.

PARALLELIZABLE PARALLEL VARCHAR(3)
Nullable
Identifies whether the function can be run in parallel.
NO
The function must be synchronous.
YES
The function can be run in parallel.

Contains the null value if the routine is a procedure.

DBINFO DBINFO VARCHAR(3)
Nullable
Identifies whether information about the database is passed to the routine.
NO
No database information is passed to the routine.
YES
Information about the database is passed to the routine.

Contains the null value if the routine is a procedure.

SOURCE_SPECIFIC_SCHEMA SRCSCHEMA VARCHAR(128)
Nullable
If this is sourced function and the source is user-defined, this column contains the name of the source schema. If this is a sourced function and the source is built-in, this column contains 'QSYS2'.

Contains the null value if the routine is not a sourced function.

SOURCE_SPECIFIC_NAME SRCNAME VARCHAR(128)
Nullable
If this is sourced function and the source is user-defined, this column contains the specific name of the source function name.

Contains the null value if the routine is not a sourced function.

IS_USER_ DEFINED_CAST CAST_FUNC VARCHAR(3)
Nullable
Identifies whether the this function is a cast function created when a distinct type was created.
NO
This function is not a cast function.
YES
This function is a cast function.

Contains the null value if the routine is a procedure.

CARDINALITY CARD BIGINT
Nullable
Specifies the cardinality for a table function.

Contains the null value if the function is not a table function or if cardinality was not specified.

FENCED FENCED VARCHAR(3)
Nullable
Identifies whether a function is fenced.
NO
The function is not fenced.
YES
The function is fenced.

Contains the null value if the routine is a procedure.

COMMIT_ON_RETURN CMTONRET VARCHAR(3)
Nullable
This column identifies whether the procedure commits on a successful return from the procedure.
NO
A commit is not performed on successful return from the procedure.
YES
A commit is performed on successful return from the procedure.
Start of changeAUTEnd of change
Start of changeProcedure will commit or rollback autonomously.End of change

Contains the null value if the routine is a function.

IASP_NUMBER IASPNUMBER SMALLINT Specifies the independent auxiliary storage pool (IASP) number.
NEW_SAVEPOINT_LEVEL NEWSAVEPTL VARCHAR(3)
Nullable
This column identifies whether the routine starts a new savepoint level.
NO
A new savepoint level is not started.
YES
A new savepoint level is started.

Contains the null value if the routine is a function.

LAST_ALTERED ALTEREDTS TIMESTAMP
Nullable
Timestamp when routine was last altered. Contains null if the routine has never been altered.
DEBUG_MODE DEBUG_MODE CHAR(1) Identifies whether the routine is debuggable.
0
The routine is not debuggable.
1
The routine is debuggable by the Unified Debugger.
2
The routine is debuggable by the system debugger.
N
The routine is disabled from being debugged by the Unified Debugger.
DEBUG_DATA DEBUG_DATA CLOB(1M)
Nullable
Reserved. Contains the null value.
ROUNDING_MODE DECFLTRND CHAR(1)
Nullable
If this is an SQL routine, identifies the DECFLOAT rounding mode.
C
ROUND_CEILING
D
ROUND_DOWN
F
ROUND_FLOOR
G
ROUND_HALF_DOWN
E
ROUND_HALF_EVEN
H
ROUND_HALF_UP
U
ROUND_UP

Contains the null value if the routine is not an SQL routine.

ROUTINE_TEXT LABEL VARGRAPHIC(50) CCSID 1200
Nullable
Contains the label for a routine. Contains the null value if a label does not exist.
Start of changeSECUREEnd of change Start of changeSECUREEnd of change Start of changeCHAR(1)End of change Start of changeIndicates whether the routine is considered secure for row access control and column access control.
N
The routine is not considered secure for row access control and column access control.
Y
The routine is considered secure for row access control and column access control.
End of change
Start of changeROUTINE_ENVIRONMENTEnd of change Start of changeRTN_ENVEnd of change Start of changeBLOB(16M)
Nullable
End of change
Start of changeContains internal environment information for a routine defined with default expressions. Contains the null value if this is a procedure or function with no default expressions.End of change
Start of changeROUTINE_DEFAULT_QDTEnd of change Start of changeRTNDFTQDTEnd of change Start of changeBLOB(1M)
Nullable
End of change
Start of changeContains internal structure for a routine defined with default expressions. Contains the null value if this is a procedure or function with no default expressions.End of change