---
title: "DB2 SQL error -104 and -199 Resolution"
description: "SQL errors in DB2 -104 and -199 are due to syntax related problems. Resolution provided in this post."
url: https://srinimf.com/2015/01/28/db2-sql-error-codes-104-and-199/
date: 2015-01-28
modified: 2026-10-10
author: "Srini"
image: https://i0.wp.com/srinimf.com/wp-content/uploads/2015/01/sql-errors.jpg?fit=500%2C321&ssl=1
categories: ["DB2"]
tags: ["DB2 SQL Error Codes"]
type: post
lang: en
---

# DB2 SQL error -104 and -199 Resolution

In our workshop DB2 is a Database. The below errors I have got many times. The reasons I found are in-correct host variables.

Example: missing codes for CHAR, using ” (double codes) instead of ‘ (Single codes).

**-104**

[ILLEGAL SYMBOL](https://srinimf.com/2011/12/18/db2-illegal/) “token”. SOME SYMBOLS THAT MIGHT BE LEGAL ARE: token-list

**Explanation**

A syntax error was detected where the symbol “token” occurs in the SQL statement. The list of symbols that might be legal shows some alternate symbols that could possibly be correct at that point, if the preceding part of the statement is entirely correct.

However, the preceding part of the statement might be incorrect. For example, if an important keyword is omitted, DB2® detects the error later, and not always immediately after the point where the keyword should appear. The list of alternate symbols are only suggestions. Some of those symbols might not even be legal for statements to be executed by DB2. Those symbols are possibly correct for statements sent to other database management systems.

**-199**

ILLEGAL USE OF KEYWORD keyword. TOKEN token-list WAS EXPECTED

**Explanation**

A syntax error was detected in the statement at the point where the keyword keyword appears.

As an aid to the programmer, a partial list of valid tokens is provided in SQLERRM as token-list. Only those tokens that will fit are listed. Some tokens in the list might not be valid in statements to be executed by DB2®; those tokens are valid for sending to other database management systems.

Related[How to Resolve -206 SQL Error Object-Not-Valid in DB2](https://srinimf.com/2021/10/16/how-to-resolve-206-sql-error-object-not-valid-in-db2/)

***Also read***

Related[DB2 SQL Error Codes You Always Need](https://srinimf.com/2010/10/23/sql_error_codes/)

### Share this:

-
- [Tweet](https://twitter.com/share)
- [![](https://i0.wp.com/assets.pinterest.com/images/pidgets/pinit_fg_en_rect_gray_20.png)](https://www.pinterest.com/pin/create/link/?url=https%3A%2F%2Fsrinimf.com%2F2015%2F01%2F28%2Fdb2-sql-error-codes-104-and-199%2F&media=https%3A%2F%2Fi0.wp.com%2Fsrinimf.com%2Fwp-content%2Fuploads%2F2015%2F01%2Fsql-errors.jpg%3Ffit%3D500%252C321%26ssl%3D1&description=DB2%20SQL%20error%20-104%20and%20-199%20Resolution)
-
- [Share on Tumblr](https://www.tumblr.com/share)
- [Share on WhatsApp (Opens in new window) WhatsApp](https://srinimf.com/2015/01/28/db2-sql-error-codes-104-and-199/?share=jetpack-whatsapp)
- [More](#)
-

- [Print (Opens in new window) Print](https://srinimf.com/2015/01/28/db2-sql-error-codes-104-and-199/?share=print)
- [Share on Reddit (Opens in new window) Reddit](https://srinimf.com/2015/01/28/db2-sql-error-codes-104-and-199/?share=reddit)
- [Share on Telegram (Opens in new window) Telegram](https://srinimf.com/2015/01/28/db2-sql-error-codes-104-and-199/?share=telegram)
- [Email a link to a friend (Opens in new window) Email](mailto:?subject=%5BShared%20Post%5D%20DB2%20SQL%20error%20-104%20and%20-199%20Resolution&body=https%3A%2F%2Fsrinimf.com%2F2015%2F01%2F28%2Fdb2-sql-error-codes-104-and-199%2F&share=email)
-

### Like this:

Like Loading…
