rasti.hil@hilandco.com +41 79 367-9677

Search This Blog

Disable all Constraint under one schema;

Disable:
begin    for cur in (select owner, constraint_name , table_name                 from all_constraints                where upper(owner) = upper('agroradb2')                   and  upper(TABLE_NAME) in (select TABLE_NAME from all_constraints where upper(owner) = upper('agroradb2')))    loop        execute immediate 'ALTER TABLE '||cur.owner||'.'||cur.table_name||' MODIFY CONSTRAINT "'||cur.constraint_name||'" DISABLE ';        end loop;    exception when others then       dbms_output.put_line(sqlerrm);end;