IBM Support

MCH3601 for IBM i SQL Stored Procedures

Troubleshooting


Problem

A common reported error for IBM i SQL Stored Procedures is message msgMCH3601 f/stored procedure t/stored procedure. This document explains why, in most cases, this is a user error.

Resolving The Problem

IBM i SQL Stored Procedures are a way for an SQL application to define and then invoke a procedure through SQL statements.
These can be SQL defined procedures where the procedure consists completely of SQL statements.

There does not have to be any code external to SQL nor external procedures where a pre-written, high-level language program is registered so that it can be called through SQL.

SQL stored procedures are not valid when called from a command line interface with the CALL command.
- This will almost always result in message MCH3601 f/stored procedure t/stored procedure.

You can also see this same MCH3601 message when calling through an SQL interface if the call is unqualified and the SQL path is not properly set to resolve to the procedure.
- This occurs because the system attempts to call the program from the library list as a system program and not as a stored procedure if the procedure is not found in the SQL path. This results in the same MCH3601 message.

Information on stored procedure and unqualified name resolution on the SQL CALL statement can be found in the DB2 UDB for iSeries SQL Programming Concepts publication.

[{"Type":"MASTER","Line of Business":{"code":"LOB68","label":"Power HW"},"Business Unit":{"code":"BU070","label":"IBM Infrastructure"},"Product":{"code":"SWG60","label":"IBM i"},"ARM Category":[{"code":"a8m0z0000001iICAAY","label":"IBM i Db2-\u003EStored Procedures"}],"ARM Case Number":"","Platform":[{"code":"PF012","label":"IBM i"}],"Version":"All Versions"}]

Historical Number

386455138

Document Information

Modified date:
29 November 2024

UID

nas8N1015432