1
I am trying to create the following table in SQL
create table Compra
(
CodCompra number(3) primary key,
DataCompra date,
DataEntrega date,
Fornecedor foreign key Fornecedor REFERENCES (codfornecedor)Fornecedor
)
ORA-00907: right parenthesis not found
When removing the "Fornecedor foreign key Fornecedor REFERENCES (codfornecedor)Fornecedor" table is created normally. And when giving the command
alter table Compra
add foreign key (Fornecedor) references Fornecedor (Fornecedor)
It features Fornecer as an invalid identifier.
Obs.: The table has been created FORNECEDOR primary key CodFornecedor.
It worked out! Thank you very much!
– luisobom