This section describes how to process files consisting of a set of commands. Command files are text files that contain SQL statements, and are useful if you want to run the same SQL statements repeatedly.
You can use any text editor that 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.
On Windows platforms you can make Interactive SQL the default editor for .sql files. Thus, you can double-click the file so that its contents appears in the SQL Statements pane of Interactive SQL.
For more information about making Interactive SQL the default editor for .sql files, see Options dialog: General tab.
You can execute command files in any of the following ways:
You can use the Interactive SQL READ statement to execute command files. For example, the following statement executes the file temp.sql:
READ temp.sql;
For more information, see READ statement [Interactive SQL].
You can load a command file into the SQL Statements pane and execute it directly from there.
You load command files into the SQL Statements pane by choosing File > Open. Enter temp.sql when prompted for the file name.
You can supply a command file as a command line argument for Interactive SQL.