Oracle 23.26SQLLab-verified · 2026-12-01

ORA-00984: column not allowed here

Oracle read something in the VALUES list as a column name, and a column cannot be used there.

Oracle AI Database 26ai Free 23.26.3.0.0
ORA-00984: column not allowed here

Jump to a cause

  1. 01A string value is written without quotes
  2. 02A string value is written in double quotes
  3. 03VALUES refers to a column of another table
  4. 04Sequence name without .NEXTVAL in VALUES
  5. 05Misspelled variable in an INSERT inside PL/SQL
  6. 06Computing a value from other columns of the same row in VALUES
  7. 07SQL*Plus substitution variable (&var) without quotes
  8. 08MySQL/SQL Server habit: NOW for the current date

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-00984 almost always comes from an INSERT ... VALUES (...) statement. The VALUES list takes values and expressions, not columns. When Oracle reads a word there as a column name, the statement fails, and SQL*Plus puts the * under that word.

Look at the word above the *. In the lab it was a string without quotes, a string in double quotes, a column of another table or of the same row, a sequence name without .NEXTVAL, NOW used instead of SYSDATE, a PL/SQL variable typo, and a SQL*Plus substitution variable.

01A string value is written without quotes

INSERT INTO customers VALUES (1, Kim, SYSDATE); failed, with the * under Kim. Without quotes, Kim is read as a column name, not as text.

Writing it as 'Kim' in single quotes inserted the row, and the SELECT returned 1 Kim.

Setup
Setuprun as lab_a
CREATE TABLE customers (cust_id NUMBER, name VARCHAR2(20), joined DATE);
OUTPUT
Table created.
Reproducerun as lab_a
INSERT INTO customers VALUES (1, Kim, SYSDATE);
✕ ERROR
INSERT INTO customers VALUES (1, Kim, SYSDATE)
                                 *
ERROR at line 1:
ORA-00984: column not allowed here
Help: https://docs.oracle.com/error-help/db/ora-00984/
Check the causerun as lab_a
COLUMN data_type FORMAT A12
SELECT column_name, data_type FROM user_tab_columns WHERE table_name = 'CUSTOMERS' ORDER BY column_id;
OUTPUT
COLUMN_NAME                    DATA_TYPE
------------------------------ ------------
CUST_ID                        NUMBER
NAME                           VARCHAR2
JOINED                         DATE

3 rows selected.

CUSTOMERS has no column called KIM, and NAME is VARCHAR2, so Kim must be a quoted string.

Text and date literals in VALUES need single quotes. Only numbers can be written as they are.

Fix: run the corrected statementrun as lab_a
INSERT INTO customers VALUES (1, 'Kim', SYSDATE);
SELECT cust_id, name FROM customers;
✓ SUCCESS
1 row created.


   CUST_ID NAME
---------- ------------------------------
         1 Kim

1 row selected.

02A string value is written in double quotes

INSERT INTO customers VALUES (1, "Kim", SYSDATE); gave the same ORA-00984 with the * under "Kim". In Oracle, double quotes mark an identifier (a column or table name), not a string. This is common when SQL is copied from MySQL or from application code.

Changing it to 'Kim' inserted the row.

Setup
Setuprun as lab_a
CREATE TABLE customers (cust_id NUMBER, name VARCHAR2(20), joined DATE);
OUTPUT
Table created.
Reproducerun as lab_a
INSERT INTO customers VALUES (1, "Kim", SYSDATE);
✕ ERROR
INSERT INTO customers VALUES (1, "Kim", SYSDATE)
                                 *
ERROR at line 1:
ORA-00984: column not allowed here
Help: https://docs.oracle.com/error-help/db/ora-00984/
Check the causerun as lab_a
COLUMN data_type FORMAT A12
SELECT column_name, data_type FROM user_tab_columns WHERE table_name = 'CUSTOMERS' ORDER BY column_id;
OUTPUT
COLUMN_NAME                    DATA_TYPE
------------------------------ ------------
CUST_ID                        NUMBER
NAME                           VARCHAR2
JOINED                         DATE

3 rows selected.

There is no Kim in the column list; the double-quoted "Kim" was read as that missing column name.

Strings use single quotes. Double quotes are only for names like "Order Date".

Fix: run the corrected statementrun as lab_a
INSERT INTO customers VALUES (1, 'Kim', SYSDATE);
SELECT cust_id, name FROM customers;
✓ SUCCESS
1 row created.


   CUST_ID NAME
---------- ------------------------------
         1 Kim

1 row selected.

03VALUES refers to a column of another table

INSERT INTO customers (...) VALUES (new_signups.cust_id, new_signups.name, SYSDATE); failed with the * under new_signups.name. VALUES cannot read rows from another table.

Rewriting it as INSERT INTO customers (cust_id, name, joined) SELECT cust_id, name, SYSDATE FROM new_signups; created 2 rows, 10 Lee and 11 Park.

Setup
Setuprun as lab_a
CREATE TABLE customers (cust_id NUMBER, name VARCHAR2(20), joined DATE);
CREATE TABLE new_signups (cust_id NUMBER, name VARCHAR2(20));
INSERT INTO new_signups VALUES (10, 'Lee');
INSERT INTO new_signups VALUES (11, 'Park');
COMMIT;
OUTPUT
Table created.


Table created.


1 row created.


1 row created.


Commit complete.
Reproducerun as lab_a
INSERT INTO customers (cust_id, name, joined) VALUES (new_signups.cust_id, new_signups.name, SYSDATE);
✕ ERROR
INSERT INTO customers (cust_id, name, joined) VALUES (new_signups.cust_id, new_signups.name, SYSDATE)
                                                                                       *
ERROR at line 1:
ORA-00984: column not allowed here
Help: https://docs.oracle.com/error-help/db/ora-00984/
Checkrun as lab_a
SELECT cust_id, name FROM new_signups ORDER BY cust_id;
OUTPUT
   CUST_ID NAME
---------- ------------------------------
        10 Lee
        11 Park

2 rows selected.

To copy data from another table, replace VALUES with a SELECT.

After the fixrun as lab_a
INSERT INTO customers (cust_id, name, joined)
SELECT cust_id, name, SYSDATE FROM new_signups;
SELECT cust_id, name FROM customers ORDER BY cust_id;
✓ SUCCESS
2 rows created.


   CUST_ID NAME
---------- ------------------------------
        10 Lee
        11 Park

2 rows selected.

04Sequence name without .NEXTVAL in VALUES

We wrote VALUES (order_seq, 'Kim') to fill the key from a sequence. The error points at line 2 with the * under order_seq. Without .NEXTVAL, Oracle reads the sequence name as a column name, and columns are not allowed in VALUES.

The cause check shows ORDER_SEQ in user_objects with type SEQUENCE, so the word is a real sequence, not a missing column. After changing it to order_seq.NEXTVAL, the INSERT worked and the row got ORDER_ID 1.

Setup
Setuprun as lab_a
CREATE TABLE orders (order_id NUMBER PRIMARY KEY, cust_name VARCHAR2(20));
CREATE SEQUENCE order_seq;
OUTPUT
Table created.


Sequence created.
Reproducerun as lab_a
INSERT INTO orders (order_id, cust_name)
VALUES (order_seq, 'Kim');
✕ ERROR
VALUES (order_seq, 'Kim')
        *
ERROR at line 2:
ORA-00984: column not allowed here
Help: https://docs.oracle.com/error-help/db/ora-00984/
Check the causerun as lab_a
SELECT object_name, object_type FROM user_objects WHERE object_name = 'ORDER_SEQ';
OUTPUT
OBJECT_NAME                    OBJECT_TYPE
------------------------------ ------------------------------
ORDER_SEQ                      SEQUENCE

1 row selected.

If the word above the * shows up as SEQUENCE in user_objects, you forgot .NEXTVAL.

Write sequence_name.NEXTVAL in VALUES. The sequence name alone is read as a column.

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


  ORDER_ID CUST_NAME
---------- --------------------
         1 Kim

1 row selected.

05Misspelled variable in an INSERT inside PL/SQL

The procedure add_customer (p_id NUMBER, p_name VARCHAR2) inserts VALUES (p_id, p_nmae, SYSDATE): the parameter name is mistyped. Creating it gave Warning: Procedure created with compilation errors, and SHOW ERRORS listed 3/39 PL/SQL: ORA-00984: column not allowed here.

p_nmae is neither a variable nor a parameter, so the SQL inside the procedure reads it as a column name, and a column is not allowed in VALUES. Comparing lines 1 and 3 in user_source shows the declared p_name and the used p_nmae.

With p_name spelled correctly the procedure compiled, EXEC add_customer(1, 'Kim') ran, and the table returned 1 Kim.

Setup
Setuprun as lab_a
CREATE TABLE customers (cust_id NUMBER, name VARCHAR2(20), joined DATE);
OUTPUT
Table created.
Reproducerun as lab_a
CREATE OR REPLACE PROCEDURE add_customer (p_id NUMBER, p_name VARCHAR2) IS
BEGIN
  INSERT INTO customers VALUES (p_id, p_nmae, SYSDATE);
END;
/
SHOW ERRORS
✕ ERROR
Warning: Procedure created with compilation errors.

Errors for PROCEDURE ADD_CUSTOMER:

LINE/COL ERROR
-------- -----------------------------------------------------------------
3/3      PL/SQL: SQL Statement ignored
3/39     PL/SQL: ORA-00984: column not allowed here
Check the causerun as lab_a
COLUMN text FORMAT a70
SELECT line, text FROM user_source WHERE name = 'ADD_CUSTOMER' AND line IN (1, 3) ORDER BY line;
OUTPUT
      LINE TEXT
---------- ----------------------------------------------------------------------
         1 PROCEDURE add_customer (p_id NUMBER, p_name VARCHAR2) IS
         3   INSERT INTO customers VALUES (p_id, p_nmae, SYSDATE);

2 rows selected.

Line 1 declares p_name, but line 3 uses p_nmae. When the two names differ, it is a typo.

In PL/SQL, ORA-00984 at the VALUES position usually means a variable or parameter name that does not match its declaration. Check the line/column from SHOW ERRORS.

Fix: run the corrected statementrun as lab_a
CREATE OR REPLACE PROCEDURE add_customer (p_id NUMBER, p_name VARCHAR2) IS
BEGIN
  INSERT INTO customers VALUES (p_id, p_name, SYSDATE);
END;
/
EXEC add_customer(1, 'Kim')
SELECT cust_id, name FROM customers;
✓ SUCCESS
Procedure created.


PL/SQL procedure successfully completed.


   CUST_ID NAME
---------- ------------------------------
         1 Kim

1 row selected.

06Computing a value from other columns of the same row in VALUES

INSERT INTO order_lines (line_id, qty, unit_price, amount) VALUES (1, 3, 1500, qty * unit_price); failed with the * under unit_price. VALUES cannot read the columns of the row being inserted, not even qty and unit_price from the same statement.

We dropped amount and re-added it as a virtual column: ALTER TABLE order_lines ADD (amount AS (qty * unit_price));. Inserting just (1, 3, 1500) then returned AMOUNT = 4500.

Setup
Setuprun as lab_a
CREATE TABLE order_lines (line_id NUMBER, qty NUMBER, unit_price NUMBER, amount NUMBER);
OUTPUT
Table created.
Reproducerun as lab_a
INSERT INTO order_lines (line_id, qty, unit_price, amount)
VALUES (1, 3, 1500, qty * unit_price);
✕ ERROR
VALUES (1, 3, 1500, qty * unit_price)
                          *
ERROR at line 2:
ORA-00984: column not allowed here
Help: https://docs.oracle.com/error-help/db/ora-00984/
Fixrun as lab_a
ALTER TABLE order_lines DROP COLUMN amount;
ALTER TABLE order_lines ADD (amount AS (qty * unit_price));
OUTPUT
Table altered.


Table altered.

For a value derived from other columns, use a virtual column or put the computed value in VALUES directly.

After the fixrun as lab_a
INSERT INTO order_lines (line_id, qty, unit_price)
VALUES (1, 3, 1500);
SELECT line_id, qty, unit_price, amount FROM order_lines;
✓ SUCCESS
1 row created.


   LINE_ID        QTY UNIT_PRICE     AMOUNT
---------- ---------- ---------- ----------
         1          3       1500       4500

1 row selected.

07SQL*Plus substitution variable (&var) without quotes

After DEFINE cust_name = Kim, we ran VALUES (1, &cust_name, SYSDATE). The new 1: line shows the statement that actually ran: VALUES (1, Kim, SYSDATE), with the * under Kim. & only pastes text; it does not add quotes.

Wrapping it as '&cust_name' made the new 1: line read 'Kim', and the row was inserted.

Setup
Setuprun as lab_a
CREATE TABLE customers (cust_id NUMBER, name VARCHAR2(20), joined DATE);
OUTPUT
Table created.
Reproducerun as lab_a
DEFINE cust_name = Kim
INSERT INTO customers VALUES (1, &cust_name, SYSDATE);
✕ ERROR
old   1: INSERT INTO customers VALUES (1, &cust_name, SYSDATE)
new   1: INSERT INTO customers VALUES (1, Kim, SYSDATE)
INSERT INTO customers VALUES (1, Kim, SYSDATE)
                                 *
ERROR at line 1:
ORA-00984: column not allowed here
Help: https://docs.oracle.com/error-help/db/ora-00984/
Check the causerun as lab_a
COLUMN data_type FORMAT A12
SELECT column_name, data_type FROM user_tab_columns WHERE table_name = 'CUSTOMERS' ORDER BY column_id;
OUTPUT
COLUMN_NAME                    DATA_TYPE
------------------------------ ------------
CUST_ID                        NUMBER
NAME                           VARCHAR2
JOINED                         DATE

3 rows selected.

NAME is VARCHAR2, so the value must be a string, but Kim on the new 1: line had no quotes.

Put substitution variables for text values inside single quotes: '&var'. The old/new lines show the real statement.

Fix: run the corrected statementrun as lab_a
DEFINE cust_name = Kim
INSERT INTO customers VALUES (1, '&cust_name', SYSDATE);
SELECT cust_id, name FROM customers;
✓ SUCCESS
old   1: INSERT INTO customers VALUES (1, '&cust_name', SYSDATE)
new   1: INSERT INTO customers VALUES (1, 'Kim', SYSDATE)

1 row created.


   CUST_ID NAME
---------- ------------------------------
         1 Kim

1 row selected.

08MySQL/SQL Server habit: NOW for the current date

We ran INSERT INTO customers VALUES (1, 'Kim', NOW), and the * landed under NOW. Oracle has no NOW, so it read the word as a column name.

The check query looked for an object or a CUSTOMERS column called NOW and returned no rows selected. Replacing NOW with SYSDATE inserted the row with the date set.

Setup
Setuprun as lab_a
CREATE TABLE customers (cust_id NUMBER, name VARCHAR2(20), joined DATE);
OUTPUT
Table created.
Reproducerun as lab_a
INSERT INTO customers VALUES (1, 'Kim', NOW);
✕ ERROR
INSERT INTO customers VALUES (1, 'Kim', NOW)
                                        *
ERROR at line 1:
ORA-00984: column not allowed here
Help: https://docs.oracle.com/error-help/db/ora-00984/
Check the causerun as lab_a
SELECT object_name, object_type FROM user_objects WHERE object_name = 'NOW'
UNION ALL
SELECT column_name, 'COLUMN' FROM user_tab_columns WHERE table_name = 'CUSTOMERS' AND column_name = 'NOW';
OUTPUT
no rows selected

no rows selected means nothing called NOW exists, neither an object nor a column.

Use SYSDATE (or CURRENT_DATE/SYSTIMESTAMP) for the current date in Oracle. Note that NOW() with parentheses gives a different error, ORA-00904.

Fix: run the corrected statementrun as lab_a
INSERT INTO customers VALUES (1, 'Kim', SYSDATE);
SELECT cust_id, name, CASE WHEN joined IS NOT NULL THEN 'date set' END AS joined FROM customers;
✓ SUCCESS
1 row created.


   CUST_ID NAME                           JOINED
---------- ------------------------------ --------
         1 Kim                            date set

1 row selected.

FAQ

What does ORA-00984 column not allowed here mean?

Oracle found a column name where only values are allowed, usually in the VALUES list of an INSERT. The * in the error output shows which word.

Why does my INSERT fail with ORA-00984 on a text value?

The text is not in single quotes. Both Kim and "Kim" are read as column names. Write 'Kim'.

How do I insert values from another table without ORA-00984?

Use INSERT INTO target (cols) SELECT ... FROM source; instead of VALUES. VALUES cannot refer to another table's columns.

Why do I get PL/SQL: ORA-00984 when compiling a procedure?

A name in VALUES is not a declared variable or parameter, so it is treated as a column. In the lab, the typo p_nmae for p_name caused it; fixing the spelling let the procedure compile and insert the row.

Why does INSERT with an &variable give ORA-00984?

SQL*Plus replaces &cust_name with the raw text Kim, so Oracle reads it as a column name. Writing '&cust_name' fixed it in our test.

Can I calculate a value from other columns inside VALUES?

No. qty * unit_price in VALUES raised ORA-00984. A virtual column amount AS (qty * unit_price) computes it for you.

Why does INSERT with a sequence give ORA-00984?

Check that you wrote order_seq.NEXTVAL, not just order_seq. In the lab, VALUES (order_seq, 'Kim') failed with ORA-00984 because the bare sequence name is read as a column. With .NEXTVAL the row was inserted with ID 1.

Can I use NOW in an Oracle INSERT?

No. In the lab, VALUES (1, 'Kim', NOW) failed with ORA-00984 because Oracle read NOW as a column name. With SYSDATE the row was inserted.

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