From: Stefan Kuhn Date: October 18 2012 2:27pm Subject: get a partial dump List-Archive: http://lists.mysql.com/mysql/228471 Message-Id: <201210181527.52118.stefhk3@web.de> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Hi everybody, I want to get insert statements from a mysql database for a number of rows of a table, specified by a where clause. I also need the inserts for the datasets linked via foreign keys in other tables. So I need a sort of partial dump, a bit like mysqldump, but restricted to a (small) set of data. This needs to be done in a Java program, using mysql via jdbc. Does anybody know an easy way to do this? Of course I could build the statements in the java code, but I thought mysql might offer that or at least parts of it. Does anybody have an idea? Thanks, Stefan