SQL Command Window

Description

The SQL Command Window provides a mechanism for testing SQL statements. There are several ways to open the SQL Command Window:

  1. From the Control Panel, select Tools > External Databases > SQL Command Window.

  2. From the Control Panel, select Tools > External Databases > Database Explorer, select a back-end database listing, right click, and select Open SQ Command Window.

  3. From the Web Projects Control Panel, select Tools > SQL Command Window.

Open SQL Command Window from Database Explorer

images/Database Explorer.png

SQL Command Window

images/SQR_SQL_Command_Window.png

The SQL Command Window requires that you have defined one or more named connection strings.

images/SQR_SQL_Command_Toolbar.png
  1. Select a named connection string from the Connection list.

  2. Select the SQL Type you wish to use. The options are:

    • "Portable" - use the multi-database Portable SQL dialect

    • "Native" - use the dialect specific to a database product

  3. Enter SQL in the SQL Command window.

  4. If you need to insert a table or column name into a SQL statement:

    • 1. Click Insert... to display the Database Explorer.

    • 2. Select the item and click Insert.

  5. Click the 'lightning' icon Execute SQL to run the SQL statement.

    • If the statement was a SELECT statement, you will see a sample of records in the Result window.

    • If the statement was an INPUT, DELETE, or UPDATE statement, you will see the number of affected rows reported in the Result window.

    • If you executed another type of SQL command, the Result window will show a success or failure message.

    • If the statement could not be processed by the back-end database (for example, because of invalid SQL syntax), you will see an error message in the Result window.

  6. You may revert to previous versions of your SQL statement:

    • 1. Click SQL History to display the SQL History dialog.

    • 2. Select a previous statement (from this session).

    • 3. Click Select.

  7. Click the 'x window' icon shown below to clear the SQL Command window.

    images/Clear_All_Button.gif
  8. Click to display the Connections dialog, where you can edit or create connection strings.