Guest User

Untitled

a guest
Mar 22nd, 2018
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.38 KB | None | 0 0
  1. CREATE OR ALTER PROCEDURE REMOVE_CONSTRAINTS AS
  2. DECLARE VARIABLE stmt VARCHAR(255);
  3. begin
  4.  
  5. BEGIN
  6. FOR
  7. select 'ALTER TABLE '||r.rdb$relation_name
  8. ||' DROP CONSTRAINT '||r.rdb$constraint_name||';'
  9. from rdb$relation_constraints r
  10. where (r.rdb$constraint_type='FOREIGN KEY')
  11. into :stmt
  12. DO
  13. BEGIN
  14. execute statement :stmt;
  15. end
  16. END
  17. END
  18.  
  19. EXECUTE PROCEDURE REMOVE_CONSTRAINTS
Add Comment
Please, Sign In to add comment