Skip to content
Advertisement

SQL Error: ORA-02298: cannot validate (SYSTEM.AEROPUERTO_FK) – parent keys not found

I’m getting the following error in on Oracle SQL Developer:

Why?

Advertisement

Answer

There are records in AEROPUERTO that point to records that do not exist in CIUDAD.

To find out which records of AEROPUERTO have that kind of issue:

If the result set is not empty, you do have orphanaged records. You’ll need to add the missing CIUDAD records in order to create the AEROPUERTO_FK foreign key, or update all the erroneous AEROPUERTO.CODIGO_CIUDAD to null (if this is a nullable field, but you will lose the city information for those airport records).

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