Skip to content
Advertisement

Making a table with a foreign key

I’m creating a SQL database in Oracle. I have created this table:

And I tried creating a second table that has a foreign key referencing it:

I get this error:

ORA-00904: “LID”: invalid identifier
00904. 00000 – “%s: invalid identifier”

Advertisement

Answer

Defining a foreign key on a column doesn’t create the column. You need to create the column first and then define it as a foreign key.

User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement