tech on the net

Oracle/PLSQL: ORA-00933

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

Description

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

  • ORA-00933: SQL command not properly ended

Cause

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

Resolution

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

Option #1

You may have executed a INSERT statement with a ORDER BY Clause. To resolve this, remove the ORDER BY clause and re-execute the INSERT statement.

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

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

You can correct the INSERT statement by removing the ORDER BY clause as follows:

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

Option #2

You may have tried to execute a DELETE statement with a ORDER BY Clause. To resolve this, remove the ORDER BY clause and re-execute the DELETE statement.

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

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

You can correct the DELETE statement by removing the ORDER BY clause as follows:

DELETE FROM supplier
WHERE supplier_name = 'IBM';