You can execute command files in any of the following ways:
You can run a command file without loading it into the SQL Statements pane.
In Interactive SQL, choose File » Run Script.
Locate the file, and click Open.
The contents of the specified file are run immediately. A Status window appears to show the execution progress.
The Run Script menu item is the equivalent of a READ statement. See below for an example of the READ statement.
You can also run a command file without loading it into the SQL Statements pane with the Interactive SQL READ statement.
In the SQL Statements pane, type the following command:
READ 'c:\\filename.sql'; |
In this statement, 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.
For more information, see READ statement [Interactive SQL].
You can supply a command file as a command line argument for Interactive SQL.
Run the dbisql utility and supply a command file as a command line argument.
For example, the following command runs the command file myscript.sql against the SQL Anywhere sample database.
dbisql -c "DSN=SQL Anywhere 12 Demo" myscript.sql |
You can load a command file into the SQL Statements pane and execute it directly from there.
Choose File » Open.
Locate the file, and click Open.
The commands are displayed in the SQL Statements pane where you read, edit, or execute them.
On Windows platforms you can make Interactive SQL the default editor for .sql command files. This lets you double-click the file so that its contents appears in the SQL Statements pane of Interactive SQL. See Setting Interactive SQL as the default editor for .sql files.
You can also a load command file into the SQL Statements pane from your favorites.
See Using favorites.
Discuss this page in DocCommentXchange.
|
Copyright © 2010, iAnywhere Solutions, Inc. - SQL Anywhere 12.0.0 |