ORA-01722 SQL Origin: Data Last updated 14 Oct 2026

ORA-01722: invalid number

Oracle tried to convert a string to a number and failed.

Exact message you may see invalid number
Seen on: SQL

Meaning

Implicit conversions from comparing VARCHAR2 with numbers, or NLS decimal settings (comma vs dot).

Common causes

  • Comparing varchar columns to numeric literals
  • Non-numeric data in a column treated as numeric
  • NLS_NUMERIC_CHARACTERS mismatch

⚡ Quick fix

  1. Compare with string literals or convert explicitly
  2. Use VALIDATE_CONVERSION/TO_NUMBER … DEFAULT NULL ON CONVERSION ERROR (12.2+)

Detailed fix by platform

SQL

  1. SELECT TO_NUMBER(code DEFAULT NULL ON CONVERSION ERROR) FROM items;

How to diagnose

  1. Expression — Where is the implicit conversion?
  2. Recent change — Did it start after a deploy, upgrade, or configuration change? Compare with the last working version.

🔧 Still not fixed?

Many errors look alike. If the steps above didn’t solve it, one of these is probably what you’re facing:

Where this error sits

Origin: Data. Errors that are often confused with or caused by this one (click to open):

245 — SQL Server: Conversion failed when converting the varchar value 'x' to data type int. (Msg 245) (SQL)2458115 — SQL Server: Arithmetic overflow error converting expression to data type int. (Msg 8115) (SQL)81158152 / 2628 — SQL Server: String or binary data would be truncated in table 'x', column 'y'. (Msg 2628) (SQL)8152 / 2628invalid_type — API Error: Invalid type — expected integer, received string (API)invalid_typeORA-00001 — ORA-00001: unique constraint (SCHEMA.PK_X) violated (SQL)ORA-00001ORA-00054 — ORA-00054: resource busy and acquire with NOWAIT specified or timeout expired (SQL)ORA-00054ORA-00904 — ORA-00904: "X": invalid identifier (SQL)ORA-00904ORA-00933 — ORA-00933: SQL command not properly ended (SQL)ORA-00933ORA-01722

Explore the map of this error Full error map →

🧠 Still stuck? Analyze your error

Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.

💬 What worked for others

No tips yet — did something else fix this for you?

Share what worked for you

Tips are checked by an editor before they appear. Links are removed.