ASA SQL User's Guide
Importing and Exporting Data
Running SQL 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
Choose File
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
In the Open dialog, find and select the file. Click Open when finished.
To run a command file immediately
Choose File
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
Supply a command file as a command-line argument for Interactive SQL.
For example, the following command runs the command file myscript.sql against the sample database.
dbisql -c "dsn= ASA 9.0 Sample" myscript.sql