Contents Index Executing command files Adaptive Server Enterprise compatibility

ASA SQL User's Guide
  Importing and Exporting Data
    Running SQL command files

Saving, loading, and running command files


You can save the commands currently present in the SQL Statements pane so that they are available for future Interactive SQL sessions. The file in which you save them is called a command file.

Command files are text files containing SQL statements. You can use any editor you like to create command files. You can include comment lines along with the SQL statements to be executed. Command files are also commonly called scripts.

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.

To save the commands from the SQL Statements pane to a file

  1. Choose File > Save As.

  2. In the Save dialog, specify a location, name and format for the file. Click Save when finished.

To 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.

To run a command file immediately

  1. Choose File > Run Script.

  2. 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:

    READ 'c:\filename.sql'

    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.

To run a command file in batch mode


Contents Index Executing command files Adaptive Server Enterprise compatibility