Java library for SQL generation

  • Thread starter Konrad Billewicz
  • Start date
K

Konrad Billewicz

Hello,

I'm searching for a library for Java which is able to generate SQL scripts
with INSERT statements based on a data from MySQL tables. I would like to
choose which rows should be exported do SQL.

Do you know anything working like that?

--
Best regards,
Konrad Billewicz

Akonet Sp. z o.o.
ul. Rozbrat 32/37
00-429 Warszawa
 
S

shakah

Konrad said:
Hello,

I'm searching for a library for Java which is able to generate SQL scripts
with INSERT statements based on a data from MySQL tables. I would like to
choose which rows should be exported do SQL.

Do you know anything working like that?

Though not quite what you're asking for, and recognizing that you might
be aware of both of the following, MySQL's mysqldump utility creates
INSERT statements, and you can create INSERT statements via a SQL
statment itself, e.g.:

SELECT CONCAT('INSERT INTO tblB(colA, colB, colC)'
,' VALUES('
,CONCAT('''', a.colOne, '''')
,CONCAT(',''', a.colTwo, '''')
,CONCAT(',''', a.colThree, '''')
,');'
)
FROM tblA a
WHERE ....
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top