omacron
Technical User
- Feb 5, 2002
- 149
I need to be able to disable foreign constraints on all tables. Is there a script to do that? Also I will need to enable after words.
Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
BEGIN
FOR X IN
(
SELECT TABLE_NAME, CONSTRAINT_NAME
FROM USER_CONSTRAINTS
WHERE CONSTRAINT_TYPE = 'R'
ORDER BY TABLE_NAME
)
LOOP
EXECUTE IMMEDIATE 'ALTER TABLE '||X.TABLE_NAME||' DISABLE CONSTRAINT '||X.CONSTRAINT_NAME;
END LOOP;
END;