ORA-00913: too many values

Hi,

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

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.

Oracle SQL Tutorials For Beginners – Learn Oracle SQL from scratch with Oracle SQL Online Course

 

About Mehmet Salih Deveci

I am Founder of SysDBASoft IT and IT Tutorial and Certified Expert about Oracle & SQL Server database, Goldengate, Exadata Machine, Oracle Database Appliance administrator with 10+years experience.I have OCA, OCP, OCE RAC Expert Certificates I have worked 100+ Banking, Insurance, Finance, Telco and etc. clients as a Consultant, Insource or Outsource.I have done 200+ Operations in this clients such as Exadata Installation & PoC & Migration & Upgrade, Oracle & SQL Server Database Upgrade, Oracle RAC Installation, SQL Server AlwaysOn Installation, Database Migration, Disaster Recovery, Backup Restore, Performance Tuning, Periodic Healthchecks.I have done 2000+ Table replication with Goldengate or SQL Server Replication tool for DWH Databases in many clients.If you need Oracle DBA, SQL Server DBA, APPS DBA,  Exadata, Goldengate, EBS Consultancy and Training you can send my email adress [email protected].-                                                                                                                                                                                                                                                 -Oracle DBA, SQL Server DBA, APPS DBA,  Exadata, Goldengate, EBS ve linux Danışmanlık ve Eğitim için  [email protected] a mail atabilirsiniz.

Leave a Reply

Your email address will not be published. Required fields are marked *