← All errors

SQLCODE -199

SQL0199 Keyword not expected

IBM message text
Keyword &1 not expected. Valid tokens: &2.
SQLCODE
-199
SQLSTATE
42601

Most common cause

A keyword in the wrong place, for example clauses in the wrong order (ORDER BY before WHERE).

Other causes

  • A missing comma between columns, so the next name is read as a keyword.
  • A reserved word used as a name without double quotes.

How to fix it

Check the clause order: SELECT, FROM, WHERE, GROUP BY, HAVING, ORDER BY, FETCH FIRST.

Related errors

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