I'm newbie in oracle and trying to create a table with a foreign key, however, an error keeps appearing, and I don't know what is wrong.
This is the little code, and when I try to create "UNIDADESMEDIDA" the error pops up:
create table TIPOUNIDAD(
ID_TIPOUNIDAD char(20) not null,
constraint TIPOUNIDAD_PK primary key(ID_TIPOUNIDAD)
);
create table UNIDADESMEDIDA(
ID_UNIDADMEDIDA integer not null,
constraint UNIDADESMEDIDA_PK primary key(ID_UNIDADMEDIDA),
constraint TIPOUNIDAD_FK foreign key(ID_TIPOUNIDAD) references TIPOUNIDAD(ID_TIPOUNIDAD)
);
Error report -
ORA-00904: "ID_TIPOUNIDAD": invalid identifier
00904. 00000 - "%s: invalid identifier"
*Cause:
*Action:
Any suggestion?