Re: Reporting child tables referencing a parnet table

2006-05-11 Thread Peter Brawley
Ben, This excellent script from Peter takes over a minute to run, and only identified RI (Referential Integrity) to one level of nesting. If I try to delete a record and get 'a foreign key constraint fails', this returns instantly without any delay and to all nested levels of RI. How does My

Re: Reporting child tables referencing a parnet table

2006-05-11 Thread Ben Clewett
MySQL, Another general comment, I'm interested in knowing This excellent script from Peter takes over a minute to run, and only identified RI (Referential Integrity) to one level of nesting. If I try to delete a record and get 'a foreign key constraint fails', this returns instantly with

Re: Reporting child tables referencing a parnet table

2006-05-11 Thread Ben Clewett
MySQL, Another general comment, I'm interested in knowing This excellent script from Peter takes over a minute to run, and only identified RI (Referential Integrity) to one level of nesting. If I try to delete a record and get 'a foreign key constraint fails', this returns instantly with

Re: Reporting child tables referencing a parnet table

2006-05-11 Thread Ben Clewett
Peter, I see... I was thinking 'db' might have been a system table name or something... This works perfectly, thanks. Ben Peter Brawley wrote: Ben Clewett wrote: Unfortunately I get: mysql> SELECT -> c.table_schema,u.table_name,u.column_name,u.referenced_column_name -> FROM i

Re: Reporting child tables referencing a parnet table

2006-05-10 Thread Peter Brawley
Ben Clewett wrote: Unfortunately I get: mysql> SELECT -> c.table_schema,u.table_name,u.column_name,u.referenced_column_name -> FROM information_schema.table_constraints AS c -> INNER JOIN information_schema.key_column_usage AS u -> USING( constraint_schema, constraint_name )

Re: Reporting child tables referencing a parnet table

2006-05-10 Thread Ben Clewett
Unfortunately I get: mysql> SELECT -> c.table_schema,u.table_name,u.column_name,u.referenced_column_name -> FROM information_schema.table_constraints AS c -> INNER JOIN information_schema.key_column_usage AS u -> USING( constraint_schema, constraint_name ) -> WHERE c.constrai

Re: Reporting child tables referencing a parnet table

2006-05-10 Thread Peter Brawley
Ben,: Dear MySQL, Can you please tell me if there is a way of listing all child tables which have a foreign key reference to a parent? Find children of db.table: SELECT c.table_schema,u.table_name,u.column_name,u.referenced_column_name FROM information_schema.table_constraints AS c INNER JOI