Common SQL Errors

ORA-00984: Column Not Allowed Here Error Explained and Fixed

June 25, 2025

ORA-00984 is raised when a column name appears in a VALUES list or similar context where Oracle only permits literals, bind variables, or expressions.

Sign up for the latest in common SQL errors from the Galaxy Team!
Welcome to the Galaxy, Guardian!
You'll be receiving a confirmation email

Follow us on twitter :)
Oops! Something went wrong while submitting the form.

What is ORA-00984: column not allowed here?

ORA-00984: column not allowed here occurs when a column reference sneaks into a VALUES list, DEFAULT clause, or CHECK expression that demands literals. Replace the column with a literal, bind variable, or sub-query, or reposition it outside the VALUES list to fix the problem.

Error Highlights

Typical Error Message

ORA-00984: column not allowed here

Error Type

Syntax Error

Language

Oracle Database

Symbol

Error Code

SQL State

Explanation

Table of Contents

What Is ORA-00984: column not allowed here?

ORA-00984 is an Oracle syntax error that fires when a column name appears where only literal values, bind variables, or deterministic expressions are permitted. The parser stops at the offending column and returns the error immediately.

The issue commonly surfaces in INSERT … VALUES statements, DEFAULT clauses, CHECK constraints, and SELECT lists inside set operators.

Oracle considers these contexts value-only zones and rejects column references.

What Causes This Error?

Oracle raises ORA-00984 when its SQL grammar rules detect a column token inside a VALUES list or similar construct.

The database engine expects constants that can be evaluated without referring to table rows.

The error can also arise from typos that turn a bind variable ( :column_val ) into a bare column name or from missing SELECT keywords inside sub-queries.

How to Fix ORA-00984

Identify the illegal column and decide whether you need its value from the current row or a literal. If you need the row value, move the INSERT to an INSERT … SELECT form.

If you intended a constant, replace the column with a literal or bind variable.

Always rerun the statement after changes.

Use EXPLAIN PLAN or autotrace to confirm that Oracle parses the SQL successfully.

Common Scenarios and Solutions

INSERT … VALUES with computed column: convert to INSERT … SELECT.

Using a column as a DEFAULT: rewrite DEFAULT to a literal or a deterministic function.

CHECK constraint referencing another column: transform CHECK into a table-level constraint or trigger.

Best Practices to Avoid This Error

Validate SQL in a modern editor like Galaxy, which highlights illegal column references before execution.

Unit-test DDL scripts in a staging database and enable SQL Developer or Galaxy linting rules for INSERT statements.

Adopt parameterized INSERT patterns that always bind values.

Review peer code for VALUES lists exceeding five columns—these are prone to copy-paste column mistakes.

Related Errors and Solutions

ORA-00936: missing expression—appears when the VALUES list is incomplete.

ORA-00927: missing equal sign—raised by malformed CHECK constraints that also often carry illegal columns.

ORA-06512: at line 1—generic PL/SQL wrapper error that can mask ORA-00984 inside dynamic SQL.

Common Causes

Related Errors

FAQs

Can ORA-00984 be ignored?

No. Oracle will not execute the statement until the illegal column reference is removed or relocated.

Does Oracle version matter?

The rule has existed since Oracle7; all supported versions (11g–23c) behave the same.

Will bind variables always solve the error?

Yes, if the intent was to supply a runtime value. They will not help if you truly need a column from another table—use INSERT … SELECT instead.

How does Galaxy help?

Galaxy’s syntax checker flags column misuse in VALUES lists in real time and suggests converting to INSERT … SELECT, preventing ORA-00984 before it hits production.

Start Querying with the Modern SQL Editor Today!
Welcome to the Galaxy, Guardian!
You'll be receiving a confirmation email

Follow us on twitter :)
Oops! Something went wrong while submitting the form.

Check out some other errors

Trusted by top engineers on high-velocity teams
Aryeo Logo
Assort Health
Curri
Rubie Logo
Bauhealth Logo
Truvideo Logo