Click here to view and discuss this page in DocCommentXchange. In the future, you will be sent there automatically.

SQL Anywhere 10.0.1 » SQL Anywhere Server - SQL Usage » Importing and Exporting Data » Using SQL command files

Using SQL command files Next Page

Running SQL command files


You can run command files interactively or in batch mode.

To run a command file immediately
  1. In Interactive SQL, from the File menu, choose Run Script.

    The Open dialog appears.

  2. In the Open dialog, locate the file, and then click Open.

    The Run Script menu item is the equivalent of a READ statement. See below for an example of the READ statement.

  3. To run a command file using the SQL Statements pane
To run a command file in batch mode
  1. Open a command prompt.

  2. 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 SQL Anywhere sample database.

    dbisql -c "DSN=SQL Anywhere 10 Demo" myscript.sql
  3. Loading SQL command files

    When you begin a new Interactive SQL session, you can load the contents of a command file into the SQL Statements pane, or you can run the contents immediately.

    To load commands from a file into the SQL Statements pane
    1. From the File menu, choose Open.

      The Open dialog appears.

    2. In the Open dialog, find and select the file.

    3. Click Open to load the command file.