← All errors

SQLCODE -117

SQL0117 Wrong number of values

IBM message text
Statement contains wrong number of values.
SQLCODE
-117
SQLSTATE
42802

Most common cause

In an INSERT the number of values does not match the number of columns, often because the column list is omitted and the table has more columns than you think.

Other causes

  • A column was added to the table, and INSERTs without a column list stayed the same.
  • A NOT NULL column with no default left out of the INSERT column list.
  • In UPDATE ... SET (a, b) = (SELECT ...) the number of columns does not match.

How to fix it

Always write the column list in INSERTs, so table changes do not break the code, and give a value to every NOT NULL column.

Related errors

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