Resolve ORA-00911 Error Message in Oracle

Learn the purpose and how to resolve the ORA-00911 error message in Oracle.

Description

When you stumble upon an ORA-00911 error, the following error message will appear:

ORA-00911: invalid character

Cause

You tried to execute a SQL declaration that included a extraordinary character.

Resolution

The option(s) to resolve this Oracle error are:

Option #1

This error occurs when you strive to use a exceptional character in a SQL statement. If a unique persona different than $, _, and # is used in the name of a column or table, the name ought to be enclosed in double quotations.

Option #2

This error may additionally manifest if you have pasted your SQL into your editor from any other program. Sometimes there are non-printable characters that may additionally be present. In this case, you attempt retyping your SQL assertion and then re-execute it.

Option #3

This error happens when a one-of-a-kind personality is used in a SQL WHERE clause and the price is not enclosed in single quotations.

For example, if you had the following SQL statement:

SELECT * FROM suppliers
WHERE supplier_name = ?;

You would receive the following error message:

You may want to right this error by means of enclosing the ? in single quotations as follows:

SELECT * FROM suppliers
WHERE supplier_name = '?';