Creating and Executing a Visual Query

Use

In the Visual Query dialog, you can create and save SQL statements on a number of different isolation levels.

Procedure

...

       1.      Choose View ® Visual Query. The system opens a window for the Visual Query dialog. The window consists of the following areas:

Ў        The top half of the window is the area for selecting tables.

Ў        The bottom half of the window is the area for defining the result.

       2.      The default value that you set in the user settings is entered for the isolation level. If you want to use a different isolation level, select the relevant isolation level in the lower part of the dialog box.

       3.      Choose Visual Query  ® Get Table. Select the table that you want to use in your database query, and choose OK to confirm. In this way, you can copy up to 16 tables to the area for selecting tables. For each of the tables copied, the system opens a window containing the names of the table columns.

Ў        To rearrange the tables, choose Visual Query  ® Arrange Tables or Visual Query  ® Cascade Tables.

Ў        To remove a table from the table selection, close the relevant window.

Ў        To remove all tables from the table selection, choose Visual Query ® Clear Window.

       4.      Select the names of the table columns that your database query relates to, and use the Drag&Drop function to copy them to the area for defining the result.

If you enter *, you copy all table columns of a table into the area for defining the result. To remove a table column from the result definition, select the column and choose Visual Query  ® Delete Column.

       5.      You can link table columns with JOINS, enter search conditions for the data records, and define the result view.

       6.      To use or edit your Visual Query again later, save it as an SQL Studio object by choosing Visual Query ® Save As.

       7.      To execute the database query that you created with Visual Query, choose Visual Query  ® Execute.

       8.      To export the SQL statements of your Visual Query to the SQL dialog, choose Visual Query  ® Export to SQL Dialog.

Result when Executing a Visual Query

The status line of the statement window indicates whether your SQL statements were executed successfully. If an error occurred, an error message is displayed in the status window of the SQL Studio. Depending on your settings, additional information such as the time it took to execute your SQL statements is also displayed there.

If your database query returns a result table, this is displayed in a separate window.