2 Replies - 637 Views - Last Post: 23 November 2018 - 02:17 AM Rate Topic: -----

#1 11ash1   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 39
  • Joined: 25-October 15

ORA-00904: : Invalid Identifier

Posted 22 November 2018 - 04:17 PM

Hello, I am currently working on a SQL assignment, but first I need to create tables which it is not letting me do. I have 3 tables which are Customer, PurchasedDeal, and Usage. I manage to create the first 2 tables successfully, but I am having a little difficulty with creating the Usage table. For some reason it is giving me this error.
Error at line 2:
ORA-00904: : Invalid Identifier


If anyone could help me understand why it is giving me this error I would really appreciate it. Thanks. It is saying it is having problems with uID INT and I am using putty to create these tables.

CREATE TABLE Customer(

CustomerID INT NOT NULL PRIMARY KEY,

CustomerName VARCHAR(100),

Phone VARCHAR(15)

);

CREATE TABLE PurchasedDeal(

DID INT NOT NULL PRIMARY KEY,

dealName VARCHAR(100),

cost FLOAT,

totalValue FLOAT,

balance FLOAT,

CustomerID INT,

FOREIGN KEY(CustomerID) REFERENCES Customer(CustomerID)

);

CREATE TABLE Usage(

uID INT,

uDate DATE,

cost FLOAT,

DealID INT,

PRIMARY KEY(DealID, uID),

FOREIGN KEY(DealID) REFERENCES PurchasedDeal(DID)

);


Is This A Good Question/Topic? 0
  • +

Replies To: ORA-00904: : Invalid Identifier

#2 astonecipher   User is offline

  • Senior Systems Engineer
  • member icon

Reputation: 2958
  • View blog
  • Posts: 11,488
  • Joined: 03-December 12

Re: ORA-00904: : Invalid Identifier

Posted 22 November 2018 - 05:33 PM

constraint t_pk primary key (x,y);


Was This Post Helpful? 0
  • +
  • -

#3 andrewsw   User is offline

  • never lube your breaks
  • member icon

Reputation: 6819
  • View blog
  • Posts: 28,255
  • Joined: 12-December 12

Re: ORA-00904: : Invalid Identifier

Posted 23 November 2018 - 02:17 AM

UID is an Oracle reserved word, I would choose a different word.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1