ORA-00984: column not allowed here

If you try to find information about this error probably you will reach the page: http://ora-00984.ora-code.com/, but read information that will not help you.

In one of my PL-SQL Scripts I was getting this ORA_00984, I’ve followed the advice from the above URL without success, I was just using a Stored Procedure parameter, not an expression or the name of another column.

The solution I’ve found:

– See if the next column (above “col3_column_with_error”) in the “values” statement is correct. In my case, the next column was with a wrong name, but the error was reported on the previous column (col2_reported_as_error).

Something like:

INSERT INTO MYTABLE (col1, col2, col3) values (col1, col2_reported_as_error, col3_column_with_error)

Hope it can help you!

2 Comments

  1. LMC says:

    Ze,
    Can you show us exactly where is wrong?
    Because I’ve tried to reproduce the 984 error message and it seems to be pointing to the right column. Don’t forget that you might be using an expression in one column using other column’s name… Here’s what I’ve got:

    SQL> create table xpto (n number, v varchar2(90), d date);

    Table created.

    SQL> insert into xpto values (1,’Antler’,sysdate);

    1 row created.

    SQL> insert into xpto values (n,’Radioseven’,sysdate);
    insert into xpto values (n,’Radioseven’,sysdate)
    *
    ERROR at line 1:
    ORA-00984: column not allowed here

    The column name is actually “n”.

  2. josedacruz says:

    It’s not an Oracle Database Server problem, it’s more about the way IDE, in this case Sql Developer reports de error (I didn’t try another).
    My post was to help someone who could get this error, like me, and try to understand it in the wrong place.

    Lets see an example with Sql Developer

    create table mytable (
    c1 number,
    c2 varchar2(100),
    c3 date
    );

    Now, in another window starting on first line:

    insert into mytable (
    c1,
    c2,
    c3)
    values
    (
    1,
    ‘test’,
    pp);

    The output error message:

    Error starting at line 1 in command:
    insert into mytable (
    c1,
    c2,
    c3)
    values
    (
    1,
    ‘test’,
    pp)
    Error at Command Line:8 Column:7
    Error report:
    SQL Error: ORA-00984: coluna não é aqui permitida
    00984. 00000 – “column not allowed here”
    *Cause:
    *Action:

    ==> It reports line 8, which its not correct, the error is at line 9, where the real error column is. In this case de correct error was “pp not defined” because I dont even have a “pp” column.

Leave a Reply

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

Bad Behavior has blocked 117 access attempts in the last 7 days.

Hyper Smash