// Oracle error reference

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
Error message
invalid character

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 or EXECUTE 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

  1. Remove the trailing semicolon from single statements sent by a program.

  2. Retype quotes as straight ' and ", and remove invisible characters.

  3. Quote identifiers that need unusual characters, or rename them.

    SELECT "order-id" FROM legacy_orders;

Related errors

More syntax and sql statements errors

The code and message text are from the Oracle Database Error Help. Browse the full Oracle error list or search every database error.

// fewer errors, faster fixes

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.