Resolve ORA-00933 Error Message in Oracle

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

Description

When you come upon an ORA-00933 error, the following error message will appear:

ORA-00933: SQL command not properly ended

Cause

You tried to execute a SQL announcement with an inappropriate clause.

Resolution

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

Option #1

You can also have executed a INSERT assertion with a ORDER BY clause. To resolve this, get rid of the ORDER BY clause and re-execute the INSERT statement.

For example, you tried to execute the following INSERT statement:

INSERT INTO suppliers
(supplier_id, supplier_name)
VALUES (24553, 'IBM')
ORDER BY supplier_id;

You can correct the INSERT assertion by using doing away with the ORDER BY clause as follows:

INSERT INTO suppliers
(supplier_id, supplier_name)
VALUES (24553, 'IBM');

Option #2

You may additionally have tried to execute a DELETE statement with a ORDER BY clause. To get to the bottom of this, do away with the ORDER BY clause and re-execute the DELETE statement.

For example, you tried to execute the following DELETE statement:

DELETE FROM suppliers
WHERE supplier_name = 'IBM'
ORDER BY supplier_id;

You can right the DELETE declaration by getting rid of the ORDER BY clause as follows:

DELETE FROM suppliers
WHERE supplier_name = 'IBM';