ORA-00936: missing expression
Oracle expected a column, value or expression and found nothing usable — typically a trailing or double comma in the SELECT list, an empty SELECT, or a keyword where a value should be.
What it means
Many places in SQL require an expression: the SELECT list, both sides of a comparison, function arguments, values lists. If one of those places is empty or contains a keyword instead, Oracle cannot build the statement and returns ORA-00936.
Common causes
- A comma before
FROMor two commas in a row in the SELECT list. SELECTwith nothing after it, often after editing a query.- An incomplete condition such as
WHERE status =. - A bind variable or substitution variable that was replaced with an empty string.
How to fix it
- Check the SELECT list for a trailing comma just before
FROM. - Check every comparison in
WHEREandONhas a value on both sides. - If the SQL is generated, print it before running it and check the generated parts.
- Run the statement piece by piece to find the empty spot.
Example
Trailing comma before FROM:
-- ORA-00936
SELECT id, name, FROM customers;
-- Works
SELECT id, name FROM customers;
In SQLlightspeed
When a statement fails, SQLlightspeed’s error panel shows the error code with a plain-language explanation and a suggestion for what to do next, together with Oracle’s own message and a link to Oracle’s documentation — for this error and dozens of other common ones.
Related errors
ORA-00933ORA-00907ORA-00904 All Oracle errors →
Oracle documentation for ORA-00936. Oracle is a registered trademark of Oracle Corporation. SQLlightspeed is not affiliated with Oracle.