0
When I try to run this part of my code in Oracle Live SQL, it gives the error "name already assigned to existing object". But there are no repeated names here, other than my primary and foreign keys. Can anyone help me find the error?
CREATE TABLE TB_PROVA (
ID_PROVA INTEGER PRIMARY KEY,
DT_PROVA DATE,
NM_SITUACAO VARCHAR(255),
ID_CIRCUITO INTEGER,
CONSTRAINT FK_CIPR FOREIGN KEY (ID_CIRCUITO) REFERENCES TB_CIRCUITO (ID_CIRCUITO) );
check again, if the message says that there must already be an object, it can be the table "TB_PROVA" or the FK "FK_CIPR", try changing the names to confirm
– Ricardo Pontual
Select * from dba_objects ...
– Motta
Even if I just run this part of the code (this single table) it gives this error. As if inside this table I have 2 objects with equal names.
– Bianca Lang
Try it like this and tell me if it worked:
CREATE TABLE TB_PROVA_NOVA (
ID_PROVA INTEGER PRIMARY KEY,
DT_PROVA DATE,
NM_SITUACAO VARCHAR(255),
ID_CIRCUITO INTEGER,
CONSTRAINT FK_CIPR_2 FOREIGN KEY (ID_CIRCUITO) REFERENCES TB_CIRCUITO (ID_CIRCUITO) );
– Clarck Maciel