The procedure declaration was used either in the parameters or the RETURNING clause. SPL routines cannot accept or return procedures.
An example of the error follows:
CREATE PROCEDURE testproc (proc1 procedure) -- error RETURNING procedure; -- error ... END PROCEDURE
Correction: Do not attempt to use the procedure declaration type within a parameter or the RETURNING clause.