Alex Rivera | Logout

Exporting result of select statement to CSV format in DB2

Asked 2009-06-29T13:49:35.737
27

Is there any way by which we can export the result of a select statment to CSV file, just like in MySQL.

MySQL Command;

SELECT col1,col2,coln into OUTFILE  'result.csv' 
FIELDS TERMINATED BY ',' FROM testtable t;
Edit
Report

1 Answer

2

This is how you can do it from DB2 client.

  1. Open the Command Editor and Run the select Query in the Commands Tab.

  2. Open the corresponding Query Results Tab

  3. Then from Menu --> Selected --> Export

answered 2012-07-20T08:03:26.047

Your Answer