ORA-00947: not enough values
The statement supplies fewer values than there are columns to fill. Compare the column list with the VALUES or SELECT list and add what is missing.
What ORA-00947 means
Oracle matches values to columns by position. ORA-00947 means the right side has fewer items than the left. If no column list is given, the INSERT must supply a value for every column in the table, so a newly added column is enough to break old code. The opposite case is ORA-00913.
Common causes of ORA-00947
- An
INSERTwith fewer values than columns. INSERT INTO t VALUES (…)without a column list after a column was added to the table.INSERT INTO t SELECT …selecting fewer columns than the table has.- A
SELECT … INTOwith more variables than selected columns.
How to fix ORA-00947
- Count the items on both sides.
- Name the columns in every
INSERT, so new columns do not break the code. - Compare with the current structure:
DESC table_name.
ORA-00947 example
Three columns, two values:
-- ORA-00947: not enough values
INSERT INTO customers (id, name, city) VALUES (2, 'Acme');
-- Works
INSERT INTO customers (id, name, city) VALUES (2, 'Acme', 'Izmir');
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-00913ORA-01400ORA-00904 All Oracle errors →
Oracle documentation for ORA-00947. Oracle is a registered trademark of Oracle Corporation. SQLlightspeed is not affiliated with Oracle.