← All errors

SQLCODE -420

SQL0420 Value for cast argument not valid

IBM message text
Value for cast argument not valid.
SQLCODE
-420
SQLSTATE
22018

Most common cause

A string converted to a number contains characters that are not a number: CAST('12A' AS INT), embedded blanks, a comma instead of a decimal point.

Other causes

  • Character fields holding codes that are partly numeric.
  • The filter excluding non-numeric values is applied after the conversion.

How to fix it

Exclude non-numeric values before converting, for example with a CASE and REGEXP_LIKE(field, '^[0-9]+$').

Related errors

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