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
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
VALUESor column list. - A string literal with an unescaped single quote, such as
'O'Brien', which ends the string early. - Using
VALUESwith several row tuples on releases before 23ai.
How to fix it
-
Check commas between every value, and double single quotes inside strings.
INSERT INTO customers (id, last_name) VALUES (1, 'O''Brien');
-
To insert several rows before 23ai, use
INSERT ALLorINSERT ... SELECT ... UNION ALL.INSERT INTO t (a, b) SELECT 1, 'x' FROM dual UNION ALL SELECT 2, 'y' FROM dual;
Related errors
ORA-00907missing right parenthesisORA-00936missing expressionORA-00933SQL command not properly ended
More syntax and sql statements errors
ORA-00911invalid characterORA-00918column ambiguously definedORA-00923FROM keyword not found where expectedORA-00937not a single-group group functionORA-00979not a GROUP BY expressionORA-01427single-row subquery returns more than one rowORA-01008not all variables boundORA-01747invalid user.table.column specification
The code and message text are from the Oracle Database Error Help. Browse the full Oracle error list or search every database error.
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.