shikarishambu
shikarishambu

Reputation: 2269

Using apache camel, sql to create csv files

I am trying to use Apache camel to run SQL, save the results to CSV file with headers. I don't know of a way to specify headers for columns within camel. Is there a way to do it? My database is SQL Server

Upvotes: 1

Views: 713

Answers (1)

Rob Farley
Rob Farley

Reputation: 15849

I don't know enough about apache camel, but because you should be careful saving non-string data as strings anyway, you could convert all your data to the appropriate varchar/nvarchar (only in your query, no table changes) and use UNION ALL to preprend your headers. It's easy, and forces you into making a decision about what format you what dates (and other types) to be in.

Of course, it's "too much work", considering there is bound to be some simple flag to do it for you.

Upvotes: 1

Related Questions