SQL

How to Resolve ORA-00903: invalid table name

Posted on
In this post, I will introduce 3 main error patterns about ORA-00903, they are: Violating Naming Rules Missing Quotes Incorrect Syntax ORA-00903 due to Violating Naming Rules Without complying with database object naming rules, we can’t create a table with unusual strings in normal way. Let’s see some cases that throw ORA-00903. First of all, […]
Data Pump

How to Disable All Referencing Constraints Before Importing Data

Posted on
Disable Constraints Before you can import with table_exists_action=truncate, you have to disable all referencing constraints. Otherwise, you may get the error: ORA-02266: unique/primary keys in table referenced by enabled foreign keys Suppose you want to import 3 schemas, HR, SH, OE. Compose disabling statement. SQL> set heading off feedback off pagesize 0 linesize 150 echo off SQL> spool /home/oracle/disable_references.sql […]
MySQL

How to Resolve Cannot add foreign key constraint in MySQL

Posted on
3 Steps to Add a Foreign Key Constraint for MySQL
Cannot add foreign key constraint Saw a MySQL ERROR 1215 (HY000): Cannot add foreign key constraint when I was trying to add a foreign key constraint on a table: mysql> alter table orders add constraint orders_customer_id_fk foreign key (customer_id) references customers (id) on delete cascade on update cascade; ERROR 1215 (HY000): Cannot add foreign key […]