← All errors

SQLCODE -303

SQL0303 Variable not compatible or value too long

IBM message text
Variable &2 not compatible or value too long.
SQLCODE
-303
SQLSTATE
22001, 42806

Most common cause

The returned value cannot be assigned to the variable: incompatible types, or a variable that is too short.

Other causes

  • The column order in SELECT differs from the variable order in INTO.
  • A date read into a character variable that is too short (at least 10 characters for *ISO, 8 for *YMD, *MDY and *DMY).

How to fix it

Align order and types between SELECT and INTO, or use a CAST in the SELECT.

Related errors

Text and codes from IBM documentation for 7.6. Checked on .