Wednesday, November 19, 2008

NetBeans: easily generate INSERT statements from query results

I wanted to call out one database tooling feature in NetBeans 6.5 that I think is pretty cool, and it's a little bit hidden.

If you execute a query and you get results, you can then do a number of interesting things with them.

insert-1.jpg

Things like show what the CREATE TABLE statement would look like, or copy and paste the data you have selected (the paste format is hard-coded right now, but next release we plan to support CSV and XML output).

The one I like the best is that you can generate INSERT statements for the data.

insert-2.jpg

Combine this with generating the CREATE TABLE statement, and it makes it really easy to hand your data set to someone else for testing or collaboration.

No comments: