ORA-00911: invalid character
The statement contains a character Oracle doesn't accept there, most often a semicolon sent through a driver, or curly quotes pasted from a document.
- Error code
ORA-00911- Category
- Syntax and SQL statements
What it means
ORA-00911 means the parser found a character that can't appear at that point. Identifiers may contain letters, digits, _, $ and #, and must start with a letter unless quoted.
Newer releases name the character and position: character_value: invalid character after token_value.
Common causes
- A trailing
;in SQL sent through JDBC, ODBC orEXECUTE IMMEDIATE. - Smart quotes (‘ ’ “ ”) pasted from a word processor or chat instead of straight quotes.
- An identifier starting with a digit or containing a hyphen, unquoted.
- Non-printing characters such as a non-breaking space copied from a web page.
How to fix it
-
Remove the trailing semicolon from single statements sent by a program.
-
Retype quotes as straight
'and", and remove invisible characters. -
Quote identifiers that need unusual characters, or rename them.
SELECT "order-id" FROM legacy_orders;
Related errors
More syntax and sql statements errors
ORA-00936missing expressionORA-00907missing right parenthesisORA-00917missing commaORA-00918column ambiguously definedORA-00923FROM keyword not found where expectedORA-00937not a single-group group functionORA-00979not a GROUP BY expressionORA-01427single-row subquery returns more than one row
The code and message text are from the Oracle Database Error Help. Browse the full Oracle error list or search every database error.
Work on Oracle in SQLly
A native SQL client for macOS, Windows and Linux with schema-aware IntelliSense, guardrails for risky statements and clear error messages, for Oracle and the other databases you use.