I got ” ORA-00913: too many values ” error in Oracle.
ORA-00913: too many values
Details of error are as follows.
ORA-00913: too many values Cause: The SQL statement requires two sets of values equal in number. This error occurs when the second set contains more items than the first set. For example, the subquery in a WHERE or HAVING clause may return too many columns, or a VALUES or SELECT clause may return more columns than are listed in the INSERT. Action: Check the number of items in each set and change the SQL statement to make them equal.
ORA-00913 error is related with the SQL statement that required two sets of equal values, you should enter more items in the second set than first set as follows.
INSERT INTO test_table (name,last_name) VALUES ('Mehmet', 'Deveci',1453); ORA-00913: too many values
too many values
Check your Insert statement and don’t use the too many values in the VALUES clause. Fix the above Insert script as follows.
INSERT INTO test_table (name,last_name) VALUES ('Mehmet', 'Deveci');
ORA-00913: too many values error is seen when subquery in the WHERE clause returns too many columns as follows.
SELECT * FROM TEST_TABLE WHERE id > 63 AND id IN (SELECT * FROM employee WHERE name LIKE 'MEH%);
You should fix above SQL Statement as follows.
SELECT * FROM TEST_TABLE WHERE id > 63 AND id IN (SELECT id FROM employee WHERE name LIKE 'MEH%);
Sometimes ORA-00913 is associated with the 2227755 bug, if you see this bug, upgrade your database or patch the Oracle version.
Do you want to learn Oracle SQL, then read the following articles.
2,268 views last month, 1 views today