Learn it on Mainframe Path. Do it with Mainframe KIT.Learn on Mainframe Path ▸
Mainframe KIT ● Nothing leaves this tab

-104

Illegal symbol in SQL statementNEGATIVE SQLCODE · CHECKED 2026-10-31
Checked against IBM documentation

Db2 hit a symbol it did not expect while reading the SQL statement. The real mistake is often earlier than the symbol it names.

QUICK ANSWER

Db2 hit a symbol it did not expect while reading the SQL statement. The real mistake is often earlier than the symbol it names.

LIKELY CAUSES, IN THE ORDER OF THIS ENTRY

  1. A keyword or clause earlier in the statement is missing, so a later symbol looks out of place.
  2. A symbol appears where the statement format does not allow it.
  3. ROLLBACK TO SAVEPOINT was coded without naming the savepoint.

CHECKED 31 Oct 2026 IBM: Db2 12 for z/OS Codes: -104

MOST LIKELY

A keyword or clause earlier in the statement is missing, so a later symbol looks out of place.

FIRST CHECK

Read the token in the message and find it in the statement text.

TRY IT ▸

Site search

What it means

Db2 reads the statement from left to right. When it meets a symbol that does not fit, it stops and returns -104 with SQLSTATE 42601. The message names that symbol as the token. The statement is not run.

The named token is only where Db2 noticed the problem. The cause may sit before it, for example a keyword that was left out. The same code is also returned when ROLLBACK TO SAVEPOINT is written without a savepoint name.

Typical causes

  • A keyword or clause earlier in the statement is missing, so a later symbol looks out of place.
  • A symbol appears where the statement format does not allow it.
  • ROLLBACK TO SAVEPOINT was coded without naming the savepoint.

How to fix it

  1. Read the token in the message and find it in the statement text.
  2. Check the text just before that token, not only the token itself.
  3. For a savepoint rollback, add the savepoint name.
  4. Correct the statement and run it again.

Example

Illustrative only; names and values are invented.

DSNT408I SQLCODE = -104, ERROR:  ILLEGAL SYMBOL "FORM"
DSNT418I SQLSTATE   = 42601 SQLSTATE RETURN CODE