1

to accomodate testing in a large batch system I would like to have the possibility to export data from many tables that are all in a "master - detail" relationship, i.e. they are connected via foreign keys. I know I can do that programmatically via DBUnit for example. Is there any framework / utility / tool for which I can just define the tabel relationships (e.g. table a is master for table b via foreign key b.1 and table c via foreign key c.1) and then give a condition for the master table (... where a.attribute = 'someCriteria') and the tool exports all connected data and lets me import the data on another database (thus I have a consistent subset of data of the source tables).

Any hints are appreciated. Thx.

Chris
  • 347
  • 1
  • 11

2 Answers2

1

You would use Jailer, a tool that do exactly what you need. It has a GUI and a command line utilty.

dogawaf
  • 360
  • 2
  • 12
  • It looks very promising to solve the problem I was trying to solve. Can't say it is correct, because I didn't test it (I have changed projects ...). But it seems that Jailer is no longer maintained, no releases for four years. – Chris Mar 09 '15 at 14:03
0

If the tool you use to browse your database is able to export results of a query, you just have to execute the result of three queries:

select c.* from C c inner join A a on c.aId = a.aId where a.attribute = '...';
select b.* from B b inner join A a on b.aId = a.aId where a.attribute = '...';
select a.* from A a where a.attribute = '...';
JB Nizet
  • 678,734
  • 91
  • 1,224
  • 1,255
  • well - if I had only three tables, I (and you) could do that. But there are many developers (not unconditionally fond of SQL) and even more tables in the source system. I want to be able to do it over and over again. – Chris Oct 22 '11 at 19:06