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 (also known as a script).
ODBC applications, including Interactive SQL applications, automatically set certain database options to values mandated by the ODBC specification. This overwrites settings by the LOGIN_PROCEDURE database option. For details and a workaround, see “LOGIN_PROCEDURE option,” Sybase IQ Reference Manual.
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 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.
To load 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.
To run 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 only required if the path contains embedded spaces.