Friday, August 10, 2012

ORA-00984: column not allowed here

This error message indicates that you are trying to insert or update any column of the table with which is not allowed,


e.g.

CREATE TABLE temp_student
  (
    stu_roll_no NUMBER(4),
    stu_name    VARCHAR2(10),
    stu_email   VARCHAR2(15),
    stu_dob DATE,
    stu_city VARCHAR2(20)
  );

INSERT INTO temp_student VALUES (3,Bhajan,'bh','04-081982','Gurgaon-India');
-- Above query will gives you this error., Because you are trying to add "Bhajan" as name of student without single quote (which is valid sequence of characters, But we have missed single quote arround this. Which is required every time you are tried to use VARCHAR, VARCHAR2, DATE etc.)

To make it work, I have changed above query as: added single quote arround "Bhajan".
INSERT INTO temp_student VALUES (3,'Bhajan','bh','04-081982','Gurgaon-India');