Executing SQL Statements

See Also

You can use the SQL Editor to write and execute SQL statements within the IDE. The SQL statement is executed on the database selected in the Connection drop-down list in the toolbar. If the database connection is closed, the IDE opens the connection to the database.

You can use the SQL Editor to create, edit and execute any SQL files in your project. To open an SQL file, right-click the SQL file (  SQL File ) in the Projects or Files window and choose Open. You can also double-click the icon to open the file in the SQL Editor.

To create and execute a SQL statement:

  1. Expand the Databases node in the Runtime window.
  2. Right-click the node for the connected database and choose Execute Command from the pop-up menu to open the SQL Editor.
  3. Make sure your current database connection is selected in the Connection drop-down list. To see the status of the listed connections, click the Select Connection in Explorer button (  Select Connection in Explorer ) in the toolbar. When you click Select Connection in Explorer, the selected connection is highlighted in the Runtime window.
  4. Enter a (DDL or DML) statement in the SQL Editor window.
  5. Click Run SQL (  Run SQL ) to run the statement.

When you execute an SQL statement, the output of the statement appears in the results pane in the lower half of the SQL Editor. If your statement has no output, the number of affected rows is displayed in the results pane.

You can access the Execute Command pop-up menu item from any subnode of a connected database ( Database Connection node ) in the Runtime window.

See Also
Connecting to a Database
Viewing Data
Defining Database Explorer Debug Mode
Creating a Table

Legal Notices