Write a SQL query by hand

DB Explorer is designed to allow users to create or modify data using the graphical interface. You can, however, use DB Explorer to edit SQL queries you write by hand.

The following SQL commands are not supported:
  • SQL commands that output information as text (for example, a command that shows a list of tables) will execute, however the text will not display.
  • SQLite-specific commands (known as dot commands, such as .show) are not supported.

When you change or modify data using this tool, the changes are done under-the-covers by SQL statements. These SQL statements are governed by the rules of the database itself. The change needs to be valid by the rules of the database, in order for the query to run successfully.

You cannot use DB Explorer to view or edit binary data (BLOB data type). In addition, for some databases you cannot use DB Explorer to view or edit text-based large objects, such as the CLOB data type in IBM-Informix database servers.

Note: The Query Editor does not provide any language syntax assistance.
  1. Open DB Explorer.
  2. Establish a connection to a database. See Change connection details.
  3. Click the Edit SQL query icon. The Edit query dialog opens.
  4. Enter your query. You have three options:

    Write and execute a new query by hand.

    1. Enter your query in the text box.
    2. Click Execute.

    Edit a previously executed query.

    1. In the Previous queries combobox, select the query to edit. The query appears in the text box.
    2. Edit the query.
    3. Click Execute.
    Edit a query generated by the Edit table data wizard.
    Tip: To use this method, you must have opened DB Explorer from the meta-schema diagram. See Show data.
    1. Select the Edit table data radio button.
    2. From the combobox, select the table.
      Tip: If you were to select Execute at this time, the table data would display in Edit mode.
      The SQL query to select the rows from the selected table displays.
    3. Select the Execute query radio button.
    4. Edit the query.
    5. Click Execute.