PL/I · DB2 SQLCODE
What does SQLCODE -401: Operand Data Types Not Compatible mean in PL/I?
A WHERE clause, arithmetic expression, or assignment in embedded SQL combines two operands whose types DB2 cannot reconcile. A common PL/I trap is a host variable declared with a stale type in DCLGEN (for example CHAR vs DECIMAL) after the underlying column's type changed.
A WHERE clause, arithmetic expression, or assignment in embedded SQL combines two operands whose types DB2 cannot reconcile. A common PL/I trap is a host variable declared with a stale type in DCLGEN (for example CHAR vs DECIMAL) after the underlying column's type changed.
Re-run DCLGEN against the current table and diff it against the copybook in the program to catch a stale host variable type, and add explicit casting in the SQL if comparing genuinely different types is intentional.