Informix Error -655
-655 RETURN value count does not match procedure declaration.
The number of values that a procedure was declared to return in the RETURNING clause does not match the number of values in a RETURN clause.
An example of the error follows:
CREATE PROCEDURE testproc () RETURNING INT, INT; ... RETURN 1,2,3; -- error ... RETURN 1; -- error END PROCEDURE
Correction: In this example, return exactly two arguments.
Oninit® Troubleshooting Guidance
Reasons / Common Causes
-655 fires when the number of values in a RETURN statement doesn't match the number the
routine's RETURNING clause declared — per the official guidance, the two counts must agree
exactly.
- A
RETURNstatement listing more values than theRETURNINGclause declared — per the official guidance's example, declaring two return values but returning three. - A
RETURNstatement listing fewer values than declared — the same example's other direction, returning one value against a two-value declaration. - A
RETURNINGclause changed during editing (adding or removing a return value) without updating everyRETURNstatement in the routine body to match.
Solutions / Resolution
- Ensure the
RETURNstatement matches the declared return count exactly, per the official guidance. - Check every
RETURNstatement in the routine, not just the first one encountered, since a routine can have multipleRETURNpoints (in different branches) and each must match the declaration.
Examples
Too many return values
CREATE PROCEDURE get_order_summary(p_order_id INT)
RETURNING INT, CHAR(10);
DEFINE v_total INT, v_status CHAR(10), v_extra INT;
...
RETURN v_total, v_status, v_extra;
-- -655: RETURNING declares 2 values, RETURN supplies 3
END PROCEDURE;
Corrected
CREATE PROCEDURE get_order_summary(p_order_id INT)
RETURNING INT, CHAR(10);
DEFINE v_total INT, v_status CHAR(10);
...
RETURN v_total, v_status;
END PROCEDURE;
Diagnostic Checks
- Count the values in the
RETURNINGclause and compare against everyRETURNstatement in the routine body, including ones inside conditional branches.
Related Errors / Related Topics
- -656 — "Routine is not declared to return values." A related return-value mismatch error,
about a
RETURNstatement appearing where noRETURNINGclause exists at all.
Check every RETURN statement in the routine, not just the first — each must match the
RETURNING clause's declared count exactly.