You can save the commands 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, or a script.
ODBC applications, including Interactive SQL applications, automatically set certain database options to values mandated by the ODBC specification. These settings overwrite those set in the LOGIN_PROCEDURE database option. For details and a workaround, see “LOGIN_PROCEDURE option,” in Chapter 2, “Database Options” of Reference: Statements and Options.
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.
Saving the commands in the SQL Statements pane
Choose File | Save As.
In the Save dialog, specify a location, name and format for the file. Click Save when finished.
Loading commands from a file into the SQL Statements pane
Choose File | Open.
In the Open dialog, find and select the file. Click Open when finished.
Running a command file immediately
Choose File | Run Script.
In the Open dialog, find and select the file. Click Open when finished.
You can supply a command file as a command-line argument for Interactive SQL.
The Run Script menu item is the functional 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. You can enclose the string in single quotation marks (as shown) if you want, but they are required only if the path contains embedded spaces.