// Oracle error reference

ORA-00917: missing comma

A list in the statement, usually the column or VALUES list of an INSERT, is missing a comma between items, or has mismatched quotes.

Error code
ORA-00917
Category
Syntax and SQL statements
Error message
missing comma

What it means

ORA-00917 means Oracle was reading a comma-separated list and found the next item without a comma before it. It is most common in INSERT ... VALUES lists, where a missing quote can also make two values run together.

Common causes

  • A missing comma in a VALUES or column list.
  • A string literal with an unescaped single quote, such as 'O'Brien', which ends the string early.
  • Using VALUES with several row tuples on releases before 23ai.

How to fix it

  1. Check commas between every value, and double single quotes inside strings.

    INSERT INTO customers (id, last_name) VALUES (1, 'O''Brien');
  2. To insert several rows before 23ai, use INSERT ALL or INSERT ... SELECT ... UNION ALL.

    INSERT INTO t (a, b)
    SELECT 1, 'x' FROM dual UNION ALL
    SELECT 2, 'y' FROM dual;

Related errors

More syntax and sql statements errors

The code and message text are from the Oracle Database Error Help. Browse the full Oracle error list or search every database error.

// fewer errors, faster fixes

Work on Oracle in SQLly

A native SQL client for macOS, Windows and Linux with schema-aware IntelliSense, guardrails for risky statements and clear error messages, for Oracle and the other databases you use.