RPG (IBM i / AS/400) · DB2 SQLCODE
What does SQLCODE -313 - Host Variable Count Mismatch mean in RPG (IBM i / AS/400)?
The number of host variables listed in an INTO clause or a USING clause doesn't match the number of columns selected or the number of parameter markers in the associated SQL statement.
The number of host variables listed in an INTO clause or a USING clause doesn't match the number of columns selected or the number of parameter markers in the associated SQL statement.
Count the columns in the SELECT list against the host variables in the INTO clause (or the parameter markers against the USING list), and keep both sides in sync whenever the statement or the variable list changes.