Executing a SQL Statement

Execute a SQL statement using the SQL Editor.

Create an Eclipse project and connection profile for the database on which you intend to run a SQL statement.

  1. Select the Navigator view.

    A tree of existing projects displays.

  2. Right-click a project in which to construct a SQL statement and select New > Other.

    A wizard-selection page appears.

  3. In the wizard-selection page, select SQL Development > SQL File.

    The Create SQL File wizard appears.

  4. Enter the name of a parent folder in the text field, or specify an existing project in the folder list below the text field.

    Alternately, you can create a project by clicking Create Project and following the wizard instructions.

  5. Specify a file name in the second text field.
  6. Specify a connection profile type, connection profile name, and database name in the corresponding drop-down lists. If no connection profile exists for the selected profile type, you can create a profile by clicking Create and following the wizard instructions.
    Note: Do not click Do not connect now.
  7. Click Finish.

    The SQL Editor opens with the file name you specified.

  8. Enter your SQL query in the SQL Editor.
  9. To execute the query, choose one of the following commands.
    Option Command
    To execute everything in the window Right-click in the SQL Editor window and select Execute All from the context menu.
    To execute only selected text Select the text you want to execute, right-click in the SQL Editor, and select Execute Selected Text from the context menu.

The results of the execution appear in the SQL Results view.

Related concepts
Database Development Perspective
SQL Results View
SQL Results History
Run
Related tasks
Executing a SQL File
Running an Ad Hoc SQL Statement