ORA-00904: : invalid identifier

itsaboutcode picture itsaboutcode · Dec 15, 2010 · Viewed 11.3k times · Source

I am trying to create a Table in Oracle and getting the error : ORA-00904: : invalid identifier

Here is my command. I really can't see any problem in it. Please help me to identify the error. Thanks.

CREATE TABLE Sale (
CustomerId INT NOT NULL ,
BarCode INT NOT NULL ,
SalesId INT NOT NULL ,
Date DATE NULL ,
CheckOut TINYINT(1) NULL ,
PRIMARY KEY (CustomerId, BarCode, SalesId) ,
CONSTRAINT fk_Customer_has_Product_Customer
FOREIGN KEY (CustomerId )
REFERENCES Customer (CustomerId )
ON DELETE NO ACTION
ON UPDATE NO ACTION,
CONSTRAINT fk_Customer_has_Product_Product1
FOREIGN KEY (BarCode )
REFERENCES Product (BarCode )
ON DELETE NO ACTION
ON UPDATE NO ACTION);

Answer

Tony Andrews picture Tony Andrews · Dec 15, 2010

The maximum length for an Oracle identifier is 30 characters. These exceed that, are 32 chars long:

  • fk_Customer_has_Product_Customer
  • fk_Customer_has_Product_Product1

See Schema Object Naming Rules