tks all but i still don't have the solution. the first post does not give recursive relationships. For example if A is a parent to B and B is a parent to C if I provide table A to the above script it only lists the FK relationship for B and does not include C.

Also pando yeah I agree that would be nice to use those tools but I would rather execute a script that dynamically drops and recreates all relevant (or I would settle for all) foreign keys in the db. The use of a tool would require user interaction and I would like to automate the procedure