What it means
Db2 accepts DATE, TIME and TIMESTAMP values as strings only in its recognised formats and lengths. When a value does not match any of them, the statement stops. The message shows the bad value, or tells you which host variable or column it came from.
-180 is about the format. If the format is right but a part is out of range, such as month 13, you get -181 instead.
Typical causes
- A host variable full of spaces or low-values passed as a date.
- A date built in the wrong layout, such as DD/MM/YYYY when the system expects another format.
- Missing separators, or the wrong separator character.
- A timestamp string that is too short or has too many fractional digits.
- Uninitialised working storage moved into a date field.
How to fix it
- Display the exact value being passed, including its length and hex content.
- Compare it with the formats Db2 accepts (ISO YYYY-MM-DD is safe) and the DATE/TIME settings in use.
- Initialise date fields to a valid default, or use an indicator variable to pass null.
- Fix how the program builds the string, then rerun.
Example
Illustrative only; names and values are invented.
SQLCODE = -180, SQLSTATE = 22007
THE DATE, TIME, OR TIMESTAMP VALUE '2026/10/26' IS INVALID