Nice way to export from DB2 command line

Stumbled on this very nice easy way to export to a delimited file from the DB2 Command Line Prompt (CLI) today.

db2 “EXPORT TO <filename> OF DEL MODIFIED BY NOCHARDEL <select statement>”

i.e.

db2 “EXPORT TO result.csv OF DEL MODIFIED BY NOCHARDEL select * from empinst.employee”

StelsCSV v3.0 – a Fast JDBC Driver for CSV/Text Files

Unfortunately it isn’t open source and/or free but I can certainly see the uses for a JDBC driver that acts on plain text files. I cannot count the number of times I have written routines for parsing text files during migration projects. Could this be the answer. Imagine being able to simply JOIN data from different text files! Nice!! Licenses start at 109 USD.

StelsCSV v3.0 – a Fast JDBC Driver for CSV/Text Files @ JAVA DEVELOPER’S JOURNAL