Adsense Ad

Thursday, 25 May 2017

Oracle: ORA-00933 Error Message

ORA-00933 Error Message

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 suppliers
(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 suppliers
(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 suppliers
WHERE supplier_name = 'IBM'
ORDER BY supplier_id;
You can correct the DELETE statement by removing the ORDER BY clause as follows:
DELETE FROM suppliers
WHERE supplier_name = 'IBM';

No comments: