Executing a SQL File

You can execute a SQL file from the SQL File Editor, from WorkSpace Navigator, and from the Database Development perspective.

Execute the SQL using one of the following methods.
Option Description
From SQL File Editor
  1. Open the SQL file from the WorkSpace Navigator project folder in which it is stored.
  2. Right-click in the editor, and select Execute All from the context menu.
SQL Results displays the result sets, database server messages, execution status (success or failure) and operation details.
Note: If the SQL file is not connected to the connection profile with which it is associated, Execute All is disabled.
From WorkSpace Navigator
  1. Right-click the file in the WorkSpace Navigator, and choose Execute SQL File.

The SQL Results view displays the result sets, database server messages, execution status (success or failure) and operation details.

From the toolbar
  1. Click the choose a SQL file to execute "Choose a .sql File to Execute" 
        icon on theDatabase Development perspective toolbar.

    The Choose a .sql File to Execute dialog appears.

  2. Select the SQL file you want to execute from the file system, and click Open.

    The Select Profile for the Editor dialog opens.

  3. Choose the Connection profile type, Connection profile name, and Database name.
  4. (Optional) If you did not create a connection profile for this database type, click Create, which launches the Create Connection Profile wizard.
  5. Click OK.

The SQL file executes, and results appear in the SQL Results view.

Related concepts
Run Overview
SQL Scrapbook
Related tasks
Creating a Launch Configuration for Procedural Objects
Running a Stored Procedure
Running a Trigger
Running a SQL Anywhere or Sybase IQ User-Defined Function
Running a SQL Anywhere or Sybase IQ Event
Viewing SQL Results

Send your feedback on this help topic to Sybase Technical Publications: pubs@sybase.com

Your comments will be sent to the technical publications staff at Sybase, Inc. For product-related issues or technical support, contact Sybase Technical Support at 1-800-8SYBASE.