RPG (IBM i / AS/400) · DB2 SQLCODE

SQLCODE -313 - Host Variable Count Mismatch

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.

SQLCODE -313 - Host Variable Count MismatchDB2 for i · SQLRPGLE

Condition

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.

Fix

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.

Related db2 sqlcode