Oracle 23.26SQLLab-verified · 2026-12-01

ORA-00913: too many values

There are more values than places to put them: in an INSERT, or in a subquery compared with one column.

Oracle AI Database 26ai Free 23.26.3.0.0
ORA-00913: too many values

Jump to a cause

  1. 01VALUES has more values than the column list
  2. 02INSERT ... SELECT * returns more columns than the target table
  3. 03An IN subquery returns two columns for one column
  4. 04UPDATE SET one column = a subquery that selects two columns
  5. 05PL/SQL SELECT INTO has more variables than selected columns
  6. 06A number with thousands separators in VALUES (1,250,000)

Lab-verifiedReproduced and fixed on Oracle AI Database 26ai Free 23.26.3.0.0 · 2026-12-01 · container image gvenzl/oracle-free:23-slim

ORA-00913 means Oracle received more values than it can use. In an INSERT, the number of values is larger than the number of target columns. In a WHERE condition, a subquery returns more columns than the left side it is compared with.

Count the columns on both sides. In the lab the causes were extra values in VALUES, INSERT ... SELECT * from a table with more columns, an IN subquery that selected 2 columns, an UPDATE ... SET col = (SELECT a, b ...), and a number written with thousands separators (1,250,000) in VALUES.

01VALUES has more values than the column list

INSERT INTO orders (order_id, cust_name) VALUES (1, 'Kim', 'NEW'); lists 2 columns but gives 3 values, so it failed with ORA-00913. The table itself has 3 columns (ORDER_ID, CUST_NAME, STATUS); the column list just left one out.

Adding status to the column list inserted the row 1 Kim NEW.

Setup
Setuprun as lab_a
CREATE TABLE orders (order_id NUMBER, cust_name VARCHAR2(20), status VARCHAR2(10));
OUTPUT
Table created.
Reproducerun as lab_a
INSERT INTO orders (order_id, cust_name) VALUES (1, 'Kim', 'NEW');
✕ ERROR
INSERT INTO orders (order_id, cust_name) VALUES (1, 'Kim', 'NEW')
            *
ERROR at line 1:
ORA-00913: too many values
Help: https://docs.oracle.com/error-help/db/ora-00913/
Check the causerun as lab_a
SELECT column_name FROM user_tab_columns WHERE table_name = 'ORDERS' ORDER BY column_id;
OUTPUT
COLUMN_NAME
------------------------------
ORDER_ID
CUST_NAME
STATUS

3 rows selected.

The table has three columns: ORDER_ID, CUST_NAME, STATUS. The INSERT column list left out STATUS, so it did not match the three values.

Add the missing column to the list, or remove the extra value.

Fix: run the corrected statementrun as lab_a
INSERT INTO orders (order_id, cust_name, status) VALUES (1, 'Kim', 'NEW');
SELECT order_id, cust_name, status FROM orders;
✓ SUCCESS
1 row created.


  ORDER_ID CUST_NAME            STATUS
---------- -------------------- ------------------------------
         1 Kim                  NEW

1 row selected.

02INSERT ... SELECT * returns more columns than the target table

INSERT INTO orders SELECT * FROM orders_stage; failed. Counting the columns showed ORDERS has 2 and ORDERS_STAGE has 3 (it has an extra loaded_at column).

Selecting only the needed columns, INSERT INTO orders (order_id, cust_name) SELECT order_id, cust_name FROM orders_stage;, created 2 rows.

Setup
Setuprun as lab_a
CREATE TABLE orders (order_id NUMBER, cust_name VARCHAR2(20));
CREATE TABLE orders_stage (order_id NUMBER, cust_name VARCHAR2(20), loaded_at DATE);
INSERT INTO orders_stage VALUES (10, 'Lee', SYSDATE);
INSERT INTO orders_stage VALUES (11, 'Park', SYSDATE);
COMMIT;
OUTPUT
Table created.


Table created.


1 row created.


1 row created.


Commit complete.
Reproducerun as lab_a
INSERT INTO orders SELECT * FROM orders_stage;
✕ ERROR
INSERT INTO orders SELECT * FROM orders_stage
            *
ERROR at line 1:
ORA-00913: too many values
Help: https://docs.oracle.com/error-help/db/ora-00913/
Check the causerun as lab_a
SELECT table_name, COUNT(*) AS cols FROM user_tab_columns WHERE table_name IN ('ORDERS', 'ORDERS_STAGE') GROUP BY table_name ORDER BY table_name;
OUTPUT
TABLE_NAME                           COLS
------------------------------ ----------
ORDERS                                  2
ORDERS_STAGE                            3

2 rows selected.

ORDERS has 2 columns and ORDERS_STAGE has 3. SELECT * passed one column too many.

Avoid SELECT * in INSERT ... SELECT. List the columns you want to copy.

Fix: run the corrected statementrun as lab_a
INSERT INTO orders (order_id, cust_name)
SELECT order_id, cust_name FROM orders_stage;
SELECT order_id, cust_name FROM orders ORDER BY order_id;
✓ SUCCESS
2 rows created.


  ORDER_ID CUST_NAME
---------- --------------------
        10 Lee
        11 Park

2 rows selected.

03An IN subquery returns two columns for one column

WHERE cust_id IN (SELECT cust_id, cust_name FROM customers WHERE grade = 'VIP') failed with ORA-00913. The left side is one column, cust_id, but the subquery returns two.

Leaving only cust_id in the subquery's SELECT made the query work, and it returned order 100.

Setup
Setuprun as lab_a
CREATE TABLE orders (order_id NUMBER, cust_id NUMBER);
CREATE TABLE customers (cust_id NUMBER, cust_name VARCHAR2(20), grade VARCHAR2(5));
INSERT INTO customers VALUES (1, 'Kim', 'VIP');
INSERT INTO customers VALUES (2, 'Lee', 'GEN');
INSERT INTO orders VALUES (100, 1);
INSERT INTO orders VALUES (101, 2);
COMMIT;
OUTPUT
Table created.


Table created.


1 row created.


1 row created.


1 row created.


1 row created.


Commit complete.
Reproducerun as lab_a
SELECT order_id FROM orders WHERE cust_id IN (SELECT cust_id, cust_name FROM customers WHERE grade = 'VIP');
✕ ERROR
SELECT order_id FROM orders WHERE cust_id IN (SELECT cust_id, cust_name FROM customers WHERE grade = 'VIP')
                                              *
ERROR at line 1:
ORA-00913: too many values
Help: https://docs.oracle.com/error-help/db/ora-00913/
Check the causerun as lab_a
SELECT cust_id, cust_name FROM customers WHERE grade = 'VIP';
OUTPUT
   CUST_ID CUST_NAME
---------- --------------------
         1 Kim

1 row selected.

Run alone, the subquery returns two columns, CUST_ID and CUST_NAME. That cannot be compared with the single cust_id on the left.

The subquery in col IN (...) must return one column. To compare two columns, write both on the left: (a, b) IN (SELECT a, b ...).

Fix: run the corrected statementrun as lab_a
SELECT order_id FROM orders WHERE cust_id IN (SELECT cust_id FROM customers WHERE grade = 'VIP');
✓ SUCCESS
  ORDER_ID
----------
       100

1 row selected.

04UPDATE SET one column = a subquery that selects two columns

Customer data was copied from a master table with SET c.cust_name = (SELECT m.cust_name, m.grade ...). One column was on the left and the subquery returned two columns, so the UPDATE failed with ORA-00913 and the * pointed at the subquery.

The master table had both values (Kim Minsu VIP, Lee Jiwon GEN). Listing both columns on the left, SET (c.cust_name, c.grade) = (SELECT m.cust_name, m.grade ...), updated 2 rows with both columns.

Setup
Setuprun as lab_a
CREATE TABLE customers (cust_id NUMBER PRIMARY KEY, cust_name VARCHAR2(20), grade VARCHAR2(5));
CREATE TABLE cust_master (cust_id NUMBER PRIMARY KEY, cust_name VARCHAR2(20), grade VARCHAR2(5));
INSERT INTO customers VALUES (1, 'Kim', 'GEN');
INSERT INTO customers VALUES (2, 'Lee', 'GEN');
INSERT INTO cust_master VALUES (1, 'Kim Minsu', 'VIP');
INSERT INTO cust_master VALUES (2, 'Lee Jiwon', 'GEN');
COMMIT;
OUTPUT
Table created.


Table created.


1 row created.


1 row created.


1 row created.


1 row created.


Commit complete.
Reproducerun as lab_a
UPDATE customers c
   SET c.cust_name = (SELECT m.cust_name, m.grade FROM cust_master m WHERE m.cust_id = c.cust_id);
✕ ERROR
   SET c.cust_name = (SELECT m.cust_name, m.grade FROM cust_master m WHERE m.cust_id = c.cust_id)
                      *
ERROR at line 2:
ORA-00913: too many values
Help: https://docs.oracle.com/error-help/db/ora-00913/
Check the causerun as lab_a
SELECT m.cust_id, m.cust_name, m.grade FROM cust_master m ORDER BY m.cust_id;
OUTPUT
   CUST_ID CUST_NAME            GRADE
---------- -------------------- -----
         1 Kim Minsu            VIP
         2 Lee Jiwon            GEN

2 rows selected.

The master table has both values the subquery picks, CUST_NAME and GRADE. The left side names only cust_name, so the counts differ.

Match the column count on both sides of SET. To copy several columns at once, put them in parentheses on the left: SET (a, b) = (SELECT x, y ...).

Fix: run the corrected statementrun as lab_a
UPDATE customers c
   SET (c.cust_name, c.grade) = (SELECT m.cust_name, m.grade FROM cust_master m WHERE m.cust_id = c.cust_id);
SELECT cust_id, cust_name, grade FROM customers ORDER BY cust_id;
COMMIT;
✓ SUCCESS
2 rows updated.


   CUST_ID CUST_NAME            GRADE
---------- -------------------- -----
         1 Kim Minsu            VIP
         2 Lee Jiwon            GEN

2 rows selected.


Commit complete.

05PL/SQL SELECT INTO has more variables than selected columns

SELECT name INTO v_name, v_sal FROM emp selects one column but gives two variables, so PL/SQL reports ORA-06550 with PL/SQL: ORA-00913: too many values. This often happens when a column is removed from the SELECT but its variable is left in INTO.

Make the lists match: SELECT name, sal INTO v_name, v_sal printed KIM 500.

Setup
Setuprun as lab_a
CREATE TABLE emp (emp_id NUMBER PRIMARY KEY, name VARCHAR2(10), sal NUMBER);
INSERT INTO emp VALUES (1, 'KIM', 500);
COMMIT;
OUTPUT
Table created.


1 row created.


Commit complete.
Reproducerun as lab_a
SET SERVEROUTPUT ON
DECLARE
  v_name emp.name%TYPE;
  v_sal  emp.sal%TYPE;
BEGIN
  SELECT name INTO v_name, v_sal FROM emp WHERE emp_id = 1;
  DBMS_OUTPUT.PUT_LINE(v_name || ' ' || v_sal);
END;
/
✕ ERROR
  SELECT name INTO v_name, v_sal FROM emp WHERE emp_id = 1;
                                 *
ERROR at line 5:
ORA-06550: line 5, column 34:
PL/SQL: ORA-00913: too many values
ORA-06550: line 5, column 3:
PL/SQL: SQL Statement ignored
Help: https://docs.oracle.com/error-help/db/ora-06550/
Check the causerun as lab_a
SELECT name, sal FROM emp WHERE emp_id = 1;
OUTPUT
NAME                                  SAL
------------------------------ ----------
KIM                                   500

1 row selected.

The variables v_name and v_sal need two columns, NAME and SAL. The SELECT listed only name.

Fix: run the corrected statementrun as lab_a
SET SERVEROUTPUT ON
DECLARE
  v_name emp.name%TYPE;
  v_sal  emp.sal%TYPE;
BEGIN
  SELECT name, sal INTO v_name, v_sal FROM emp WHERE emp_id = 1;
  DBMS_OUTPUT.PUT_LINE(v_name || ' ' || v_sal);
END;
/
✓ SUCCESS
KIM 500

PL/SQL procedure successfully completed.

06A number with thousands separators in VALUES (1,250,000)

The amount was copied from a report as 1,250,000 and pasted into VALUES (1, 'KIM', 1,250,000). SQL reads every comma as a value separator, so the INSERT had 5 values (1, 'KIM', 1, 250, 000) for 3 columns and failed with ORA-00913.

TO_NUMBER('1,250,000', '9G999G999', ...) returned 1250000. Writing the literal without commas, 1250000, created the row.

Setup
Setuprun as lab_a
CREATE TABLE payments (pay_id NUMBER PRIMARY KEY, cust_name VARCHAR2(20), amount NUMBER);
OUTPUT
Table created.
Reproducerun as lab_a
INSERT INTO payments (pay_id, cust_name, amount) VALUES (1, 'KIM', 1,250,000);
✕ ERROR
INSERT INTO payments (pay_id, cust_name, amount) VALUES (1, 'KIM', 1,250,000)
            *
ERROR at line 1:
ORA-00913: too many values
Help: https://docs.oracle.com/error-help/db/ora-00913/
Checkrun as lab_a
SELECT TO_NUMBER('1,250,000', '9G999G999', 'NLS_NUMERIC_CHARACTERS=''.,''') AS amount FROM dual;
OUTPUT
    AMOUNT
----------
   1250000

1 row selected.

Write number literals without grouping separators. If the value arrives as text with commas, quote it and convert with TO_NUMBER and a format model.

After the fixrun as lab_a
INSERT INTO payments (pay_id, cust_name, amount) VALUES (1, 'KIM', 1250000);
SELECT pay_id, cust_name, amount FROM payments;
✓ SUCCESS
1 row created.


    PAY_ID CUST_NAME                AMOUNT
---------- -------------------- ----------
         1 KIM                     1250000

1 row selected.

FAQ

What does ORA-00913 too many values mean?

Oracle got more values than target columns. In an INSERT there are more values than columns; in a condition, a subquery returns more columns than the left side.

Why do I get ORA-00913 in INSERT INTO ... SELECT?

The SELECT returns more columns than the table, often because of SELECT * from a table with extra columns. List only the columns you need.

Why does my subquery give ORA-00913?

A subquery used with IN or = against one column selects two or more columns. Keep only the column being compared.

Why does UPDATE ... SET col = (SELECT ...) give ORA-00913?

The subquery selects more columns than the left side of SET. Select one column, or update several columns together with SET (col1, col2) = (SELECT x, y ...).

What is the difference between ORA-00913 and ORA-00947?

ORA-00913 means too many values, ORA-00947 means not enough. Both are fixed by making the column count and the value count the same.

Why do I get PL/SQL: ORA-00913 in SELECT INTO?

The INTO list has more variables than the SELECT list has columns. Remove the extra variable or select the missing column.

Why does INSERT give ORA-00913 when the column count looks right?

Check numbers with commas. 1,250,000 without quotes is three values, not one. In the lab VALUES (1, 'KIM', 1,250,000) failed and 1250000 worked.

How we verify

Each scenario starts from fresh database users. A script runs the setup, confirms the exact error code, applies the fix and runs the statement again. The output shown is what the database printed, saved by the script.

lab_a and lab_b are ordinary users created for the test; system is the DBA account. Oracle AI Database 26ai Free Release 23.26.3.0.0 - Develop, Learn, and Run for Free 23.26.3.0.0