Run SQL Scripts Overview
Use the Run SQL Scripts window to create, edit, run, and troubleshoot scripts of SQL statements. When
you have finished working with the scripts, you can save the them to your PC.
When you first open Run SQL Scripts, you are automatically be connected to the database that you launched
Run SQL Scripts from. You can change your connection to a different database. For more information, see
Connect to another database.
The Run SQL Scripts window has several key areas. For more information on each of these areas, see the
following:
Examples
Input
Output
Tips for the Run SQL Scripts window:
- You can change the font used in the Run SQL Scripts window from the View menu.
- You can use the SQL scripts function without starting System i Navigator. Once you have saved a
script file, you can double-click on the script file to use it without starting System i Navigator.
- Use a semicolon (;) to separate statements.
- Use two dashes (--) to make the rest of the line a comment. (Comments are supported by Version 4
Release 3 or later.)
- To make longer comments, start the comment with "/*" and use "*/" to end it.
Comments made in this manner can be any length. (Comments are supported by Version 4 Release 3 or later.)
- Place the cursor in a statement and the statement is automatically selected when run.
- Control Language (CL) commands can be executed by placing CL: at the beginning of a statement. You can
use any CL command that can be submitted from a batch job.