Oracle errors

ORA-00936: missing expression

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

How to fix it

  1. Check the SELECT list for a trailing comma just before FROM.
  2. Check every comparison in WHERE and ON has a value on both sides.
  3. If the SQL is generated, print it before running it and check the generated parts.
  4. 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.