Export data from H2 database into CSV

user1633277 picture user1633277 · Jun 20, 2013 · Viewed 35k times · Source

I have a stand alone H2 server up and running gathering data. For testing I want to get data out my server into a CSV file. Are there any tools for that?

Answer

partha picture partha · Oct 29, 2013

For those who are too lazy to read documentation, this is perhaps all that you need.

call CSVWRITE ( 'C:/MyFolder/MyCSV.txt', 'SELECT * FROM MYTABLE' ) 

You need to just run the call (mentioned above) in the browser based client of H2 that you are most likely using.

For those who are not quite that lazy, this is the link to read - http://www.h2database.com/html/functions.html#csvwrite.