Disable all table constraints in Oracle

后端 未结 11 910
耶瑟儿~
耶瑟儿~ 2020-11-28 18:35

How can I disable all table constrains in Oracle with a single command? This can be either for a single table, a list of tables, or for all tables.

11条回答
  •  有刺的猬
    2020-11-28 18:54

    You can execute all the commands returned by the following query :

    select 'ALTER TABLE '||substr(c.table_name,1,35)|| ' DISABLE CONSTRAINT '||constraint_name||' ;' from user_constraints c --where c.table_name = 'TABLE_NAME' ;

提交回复
热议问题