Disable constraints for child tables


/ Published in: SQL
Save to your folder(s)



Copy this code and paste it in your HTML
  1. SELECT
  2. 'ALTER TABLE '||TABLE_NAME||' DISABLE CONSTRAINTS '||CONSTRAINT_NAME||';'
  3. FROM
  4. user_constraints
  5. WHERE
  6. r_constraint_name =
  7. (SELECT constraint_name FROM user_constraints WHERE
  8. LOWER(TABLE_NAME) = 'parent_table' AND constraint_type = 'P')
  9. AND constraint_type = 'R'
  10. ;

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.