Saving, Loading, and Running Command Files

Save the commands in the SQL Statements pane so they are available for future Interactive SQL sessions.

The files in which you save them, called command files and commonly referred to as scripts, are text files containing SQL statements. You can use any editor to create command files, and include comment lines along with the SQL statements to be executed. When you begin a new session, you can load the contents of a command file into the SQL Statements pane, or you can run the contents immediately.

Action Description
Save the commands from the SQL Statements pane to a file
  1. Choose File > Save.
  2. In the Save dialog, specify a location, name, and format for the file. Click Save when finished.
Load commands from a file into the SQL Statements pane
  1. Choose File > Open.
  2. In the Open dialog, find and select the file. Click Open when finished.
Run a command file immediately
  1. Choose File > Run Script.
  2. The Run Script menu item is the equivalent of a read statement. For example, in the SQL Statements pane, you can also run a command file by typing the following, where c:\filename.sql is the path, name, and extension of the file. Single quotation marks (as shown) are required only if the path contains spaces:
    READ "c:\filename.sql"
  3. In the Open dialog, find and select the file. Click Open when finished.
The Run Script menu item is the equivalent of a READ statement. For example, in the SQL Statements pane, you can also run a command file by typing the following, where c:\filename.sql is the path, name, and extension of the file. Single quotation marks (as shown) are required only if the path contains spaces:
READ 'c:\filename.sql'