IBM Support

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

Troubleshooting


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.

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.

[{"Product":{"code":"SWG60","label":"IBM i"},"Business Unit":{"code":"BU054","label":"Systems w\/TPS"},"Component":"DB2 for IBM i","Platform":[{"code":"PF012","label":"IBM i"}],"Version":"7.2.0;7.2;7.1.0;7.1;6.1.1;6.1.0;6.1","Edition":"","Line of Business":{"code":"LOB08","label":"Cognitive Systems"}},{"Product":{"code":"SSC5L9","label":"IBM i 7.2"},"Business Unit":{"code":"BU054","label":"Systems w\/TPS"},"Component":" ","Platform":[{"code":"","label":null}],"Version":"","Edition":"","Line of Business":{"code":"","label":""}},{"Product":{"code":"SSC52E","label":"IBM i 7.1"},"Business Unit":{"code":"BU054","label":"Systems w\/TPS"},"Component":" ","Platform":[{"code":"","label":null}],"Version":"","Edition":"","Line of Business":{"code":"","label":""}},{"Product":{"code":"SSC3X7","label":"IBM i 6.1"},"Business Unit":{"code":"BU054","label":"Systems w\/TPS"},"Component":" ","Platform":[{"code":"","label":null}],"Version":"","Edition":"","Line of Business":{"code":"","label":""}}]

Historical Number

625873449

Document Information

Modified date:
18 December 2019

UID

nas8N1011114