You can execute SQL script files in any of the following ways:
You can run a SQL script file without loading it into the SQL Statements pane.
In Interactive SQL, click 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 SQL script file without loading it into the SQL Statements pane with the Interactive SQL READ statement.
In the SQL Statements pane, type the following statement:
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.
You can supply a SQL script file as a command line argument for Interactive SQL.
Run the dbisql utility and supply a SQL script file as a command line argument.
For example, the following command runs the SQL script file myscript.sql against the SQL Anywhere sample database.
dbisql -c "DSN=SQL Anywhere 12 Demo" myscript.sql |
You can load a SQL script file into the SQL Statements pane and execute it directly from there.
Click File » Open.
Locate the file, and click Open.
The statements 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 script files. This lets you double-click the file so that its contents appears in the SQL Statements pane of Interactive SQL.
You can also load a SQL script file into the SQL Statements pane from your favorites.
Discuss this page in DocCommentXchange.
|
Copyright © 2012, iAnywhere Solutions, Inc. - SQL Anywhere 12.0.1 |