DBAtlas · Database operations atlas

ORA-01722: Invalid number

Oracle

What does it mean?

A character string that cannot be converted to a number was used where a numeric context is required. An implicit or explicit conversion failed.

Why does it happen?

Comparing a numeric column with text (e.g. WHERE num_col = 'ABC'), inserting a value containing letters into a numeric field, an unsuitable format for TO_NUMBER, or a decimal/group separator mismatch (comma vs period).

How to fix it

Find the expression with the failing conversion; usually a WHERE condition or an INSERT value. Ensure type compatibility in text/number comparisons and use explicit conversion where needed: TO_NUMBER(my_column) or TO_CHAR for the text side. Prevent non-numeric input into numeric columns at the application layer. Watch the NLS_NUMERIC_CHARACTERS setting.

Open in DBAtlas →

More from this engine