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
CREATE TABLE customers (cust_id NUMBER, name VARCHAR2(20), joined DATE);Table created.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/COLUMN data_type FORMAT A12
SELECT column_name, data_type FROM user_tab_columns WHERE table_name = 'CUSTOMERS' ORDER BY column_id;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.
INSERT INTO customers VALUES (1, 'Kim', SYSDATE);
SELECT cust_id, name FROM customers;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
CREATE TABLE customers (cust_id NUMBER, name VARCHAR2(20), joined DATE);Table created.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/COLUMN data_type FORMAT A12
SELECT column_name, data_type FROM user_tab_columns WHERE table_name = 'CUSTOMERS' ORDER BY column_id;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".
INSERT INTO customers VALUES (1, 'Kim', SYSDATE);
SELECT cust_id, name FROM customers;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
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;Table created.
Table created.
1 row created.
1 row created.
Commit complete.INSERT INTO customers (cust_id, name, joined) VALUES (new_signups.cust_id, new_signups.name, SYSDATE);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/SELECT cust_id, name FROM new_signups ORDER BY cust_id; CUST_ID NAME
---------- ------------------------------
10 Lee
11 Park
2 rows selected.To copy data from another table, replace VALUES with a SELECT.
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;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
CREATE TABLE orders (order_id NUMBER PRIMARY KEY, cust_name VARCHAR2(20));
CREATE SEQUENCE order_seq;Table created.
Sequence created.INSERT INTO orders (order_id, cust_name)
VALUES (order_seq, 'Kim');VALUES (order_seq, 'Kim')
*
ERROR at line 2:
ORA-00984: column not allowed here
Help: https://docs.oracle.com/error-help/db/ora-00984/SELECT object_name, object_type FROM user_objects WHERE object_name = 'ORDER_SEQ';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.
INSERT INTO orders (order_id, cust_name)
VALUES (order_seq.NEXTVAL, 'Kim');
SELECT order_id, cust_name FROM orders;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
CREATE TABLE customers (cust_id NUMBER, name VARCHAR2(20), joined DATE);Table created.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 ERRORSWarning: 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 hereCOLUMN text FORMAT a70
SELECT line, text FROM user_source WHERE name = 'ADD_CUSTOMER' AND line IN (1, 3) ORDER BY line; 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.
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;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
CREATE TABLE order_lines (line_id NUMBER, qty NUMBER, unit_price NUMBER, amount NUMBER);Table created.INSERT INTO order_lines (line_id, qty, unit_price, amount)
VALUES (1, 3, 1500, qty * unit_price);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/ALTER TABLE order_lines DROP COLUMN amount;
ALTER TABLE order_lines ADD (amount AS (qty * unit_price));Table altered.
Table altered.For a value derived from other columns, use a virtual column or put the computed value in VALUES directly.
INSERT INTO order_lines (line_id, qty, unit_price)
VALUES (1, 3, 1500);
SELECT line_id, qty, unit_price, amount FROM order_lines;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
CREATE TABLE customers (cust_id NUMBER, name VARCHAR2(20), joined DATE);Table created.DEFINE cust_name = Kim
INSERT INTO customers VALUES (1, &cust_name, SYSDATE);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/COLUMN data_type FORMAT A12
SELECT column_name, data_type FROM user_tab_columns WHERE table_name = 'CUSTOMERS' ORDER BY column_id;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.
DEFINE cust_name = Kim
INSERT INTO customers VALUES (1, '&cust_name', SYSDATE);
SELECT cust_id, name FROM customers;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
CREATE TABLE customers (cust_id NUMBER, name VARCHAR2(20), joined DATE);Table created.INSERT INTO customers VALUES (1, 'Kim', NOW);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/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';no rows selectedno 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.
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;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