RPG (IBM i / AS/400) · DB2 SQLCODE
What does SQLCODE -301 - Host Variable Data Type Not Compatible mean in RPG (IBM i / AS/400)?
A static SQL statement used an input host variable whose RPG data type can't be implicitly converted to the type SQL needs at that position - for example a data structure or pointer used where a scalar numeric or character host variable is expected.
A static SQL statement used an input host variable whose RPG data type can't be implicitly converted to the type SQL needs at that position - for example a data structure or pointer used where a scalar numeric or character host variable is expected.
Declare host variables with SQL-compatible RPG types (packed or zoned numeric, character, or the SQL date/time types) and avoid passing complex data structures directly as scalar host variables.