DB2 Stored Procedures – Procedure Doesn’t Have Compatible Arguments

db2stored-procedures

Getting an error while invoking my procedure named LOG_MSG_TEST(). Procedure Schema name is ADMINIST.

My procedure has one INTEGER input parameter and one VARCHAR output parameter.

I am calling this procedure in the CLP using mentioned syntax:

call ADMINIST.LOG_MSG_TEST(1);

It is existing in the SYSCAT.PROCEDURES table, but I am still getting the following error:

No authorized routine named "ADMINIST.LOG_MSG_TEST" of type
"PROCEDURE" having compatible arguments was found.. SQLCODE=-440,
SQLSTATE=42884, DRIVER=4.17.30

Best Answer

You say that your procedure has two parameters: an input INTEGER and an output VARCHAR, however, you call a procedure with only one argument, therefore DB2 is looking for the procedure that has only one INTEGER argument.

You should call it like so:

call ADMINIST.LOG_MSG_TEST(1,?);

where the question mark is a placeholder for the output argument.