To create an SQL query string using QBE

  1. Select Option from the menu bar. A drop down list appears.

  2. Select Query by Example Interface from the drop down list. The Create QBE Wizard Introduction dialog box appears.

  3. Click the Next button. The Choose Table(s)/Column(s) dialog box appears.

  4. Select the table(s) or view(s) from the Table Name drop down list. The columns contained in the selected table(s) or view(s) appear in the panel to the left in the dialog box.

  5. Select the columns from the left panel using the mouse. The selected columns will be highlighted.

  6. NOTE To select multiple columns hold down the Ctrl key and use the mouse to select the columns.

  7. Click the Add button. The selected columns will appear in the panel on the right.

  8. Click the Next button. The Adjust Selected Columns Order dialog box appears.

  9. To expand the table to view all the available columns double click the table.

  10. Double click the Alias Name field for a column to specify an alias name.

  11. Click the Next button. The Where Clause window appears.

  12. To set a Where clause:

    1. Select a column from the Table(alias)Column(alias) drop down list on the left.

    2. Select an operator from the Operator drop down list.

    3. Enter a value in the Table(alias)Column(alias) field on the right or select a column from the drop down list.

  13. Click Next. The Order by Clause window appears.

  14. Select the sort order for the columns using the Order by Clause dialog box.

  15. Click the Next button. The Building SQL Review dialog box appears.

  16. To save the query:

    1. Click the Save button. The Save dialog box appears.

    2. Enter a name and location for the query in the dialog box and click the Save button.

  17. To save the query as a stored command:

    1. Click the Save as stored command button. The Input stored command name dialog box appears.

    2. Enter a name in the Stored command name field.

    3. Click OK.

  18. To preview the query:

    1. Click the Preview button. The Preview QBE Result dialog box appears.

    2. Browse the results using the scroll bars. For large results use the Page Up, Page Down, First and Last buttons.

  19. To create a view on the query:

    1. Click the Create as view button. The Input View Name dialog box appears.

    2. Enter a name for the view in the View name field.

  20. When you have finished with QBE click the Close button.


Related topic:

Query By Example (QBE)