Learn the cause and how to resolve the ORA-02291 error message in Oracle.
Ora 02064
- ORA-02021: DDL operations are not allowed on a remote database. Cause: An attempt was made to use a DDL operation on a remote database. For example, 'CREATE TABLE.
- SQL Error: ORA-02021: DDL operations are not allowed on a remote database 02021. 00000 - 'DDL operations are not allowed on a remote database'.Cause: An attempt was made to use a DDL operation on a remote database.
Description
ORA-02021 DDL operations are not allowed on a remote database. Ooiewe asked on 2001-12-03. Oracle Database; 5 Comments. Last Modified: 2008.
When you encounter an ORA-02291 error, the following error message will appear:
- ORA-02291: integrity constraint <constraint name> violated - parent key not found
Cause
You tried to reference a table using a unique or primary key, but the columns that you listed did not match the primary key, or a primary key does not exist for this table.
Ora 02051
Resolution
The option(s) to resolve this Oracle error are:
Option #1
This error commonly occurs when you have a parent-child relationship established between two tables through a foreign key. You then have tried to insert a value into the child table, but the corresponding value does not exist in the parent table.
To correct this problem, you need to insert the value into the parent table first and then you can insert the corresponding value into the child table.
For example, if you had created the following foreign key (parent-child relationship).
Then you try inserting into the products table as follows:
You would receive the following error message:
Ora-02021 Create Table
Ora 00214
Since the supplier_id value of 5000 does not yet exist in the supplier table, you need to first insert a record into the supplier table as follows:
Then you can insert into the products table: