IBM Support

Saving Result Data to .csv or .xls Files Using Run SQL Scripts

Technote (troubleshooting)


Problem(Abstract)

The purpose of the document is to illustrate using screen shots how to save result set data into comma separated values (csv) or Microsoft Excel
Spreadsheets using Run SQL Scripts. This support was added into iSeries Navigator 6.1.

Resolving the problem

The purpose of the document is to illustrate using screen shots how to save result set data into comma separated values (csv) or Microsoft Excel Spreadsheets using Run SQL Scripts. This support was added into iSeries Navigator 6.1. This does not work against Stored Procedure calls.

1. With the Run SQL Scripts open, select the Allow Save Results option from the menu:

This shows the Run SQL Scripts window with the Options menu highlighted and Allow Save Results checked.

2. With that option selected, you can right click on the results and the following options will appear:

Options after clicking on results.

3. Select Save Results. A list of different file types to save to will be displayed, including csv and xls, and you can include column headers as the first row of the data:

This shows the Save Results dialog with Comma Seperated Value (.csv) highlighted

4. Click OK and the data is written out to the specified file in the format selected:

This is a screen shot of the CSV file open in Notepad.

Cross reference information
Segment Product Component Platform Version Edition
Operating System IBM i 7.2
Operating System IBM i 7.1
Operating System IBM i 6.1

Historical Number

625873449

Document information

More support for: IBM i
DB2 for IBM i

Software version: 6.1, 6.1.0, 6.1.1, 7.1, 7.1.0, 7.2, 7.2.0

Operating system(s): IBM i

Reference #: N1011114

Modified date: 11 September 2012