Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

"SET FOREIGN_KEY_CHECKS = 0;" Oracle Equivalent

Is there some equivalent to the Mysql specific instruction that disable the check of the foreign keys constraints ?
SET FOREIGN_KEY_CHECKS = 0;

like image 380
abderrahim_05 Avatar asked Jun 21 '13 10:06

abderrahim_05


People also ask

What is set foreign_key_checks 0?

Setting foreign_key_checks to 0It affects data definition statements: DROP SCHEMA drops a schema even if it contains tables that have foreign keys that are referred to by tables outside the schema, and DROP TABLE drops tables that have foreign keys that are referred to by other tables.

How do you set a foreign key to zero in SQL?

You can disable foreign key check in MySQL by setting the system variable foreign_key_checks to 0. However, please note, after you enable foreign key checks, MySQL will not re-validate your existing data that you added after disabling foreign key check. It will only check any new additions/updates to your database.

How do I disable referential integrity constraints in Oracle?

There are multiple ways to disable constraints in Oracle. constraint_name; Another way to enable and disable constraints in Oracle would be to either use a plsql block or write a script. Execute Immediate 'alter table '||:tab_name||' disable constraint '||tabCons(numCount);

How do you identify a foreign key constraint?

Using SQL Server Management Studio Open the Table Designer for the table containing the foreign key you want to view, right-click in the Table Designer, and choose Relationships from the shortcut menu. In the Foreign Key Relationships dialog box, select the relationship with properties you want to view.


1 Answers

IF Your asking for a query to disable a foreign key then try this :

ALTER TABLE mytable
disable CONSTRAINT fk_mytable;

like image 123
Moudiz Avatar answered Sep 21 '22 03:09

Moudiz