Query your database using the Run SQL Scripts interface

The Run SQL Scripts window in iSeries™ Navigator allows you to create, edit, run, and troubleshoot scripts of SQL statements. When you have finished working with the scripts, you can save them to your PC.

You can start the Run SQL Scripts interface by expanding the system name, Databases, and right-clicking the database that you want to connect to.

You can use the Examples list to build your scripts, manually create your statement, retrieve the SQL for an existing object using the generate SQL function, or build a script using SQL Assist.

You can check the syntax of your SQL by clicking Check Syntax. Additional ways of debugging your programs and scripts include debugging messages in the job log and starting the iSeries System debugger. When syntax checking is complete, you can save the script by selecting Save from the File menu.

To run an SQL script, select one of the following options from the Run menu:

The results are added to the end of the Messages tab. If the Smart Statement Selection option on the Options menu is not checked, the text that is selected is run as a single SQL statement.
Related tasks
Build SQL statements with SQL Assist
View the job log
Start the iSeries System Debugger
Create a view combining data from multiple tables
Related information
Using interactive SQL