MicroStation CONNECT Edition Help

To Use the Visual SQL Query Builder to Build a Query: Example 3

Note: The Visual SQL Data Browser only displays the data. Make edits to the database in the Forms mode.
Note: To edit any of the Where clauses, click the clause in the Where Fields list box. Dynamically change the field, operator, value, and AND/OR clause members as you would normally do when building an SQL statement. Clicking Apply conforms the SQL Select Statement to your changes in the Where Fields dialog. You can also delete the clause by clicking Clear.
Note: If your selection in Available Fields is a character type, your entry in the Value text field (for example, 100) is displayed with single quotes around it in the Value column of the Where Fields list box (is displayed as '100').
Note: Common Operators do dnot work with character fields.
  1. Click Clear All to clear any existing tables.
  2. In the Select tab page, click Tables or select menu option Tables > Open Table.
  3. In the Select Table dialog, double-click Parcel.
  4. In the Select Table dialog, click Cancel.
  5. In the Parcel dialog, double-click the Parcel_no, owner, house_num, str_name fields.

    The following displays in the SQL Select Statement text box:

    SELECT  parcel_no, owner, house_num, str_name 
     FROM  parcel
  6. Click the Where tab.

    The Where tab page opens.



  7. In the Available Fields list box, click the parc_value field.

    The selected field appears in the Where Fields list box.

  8. Click >= (greater than or equal to). In the Value text field, type 50000 and press <Enter>.
  9. Click And to create the second WHERE clause.

    AND displays in the Where Fields list box.

  10. Click parc_area in the Available Fields list box, click >= (greater than or equal to), enter 100000 in the Value text field and press <Enter>.

    The entered operator and value display in the Where Fields list box.

  11. Click Apply to add the clause in the Where Fields list box to the SQL Select Statement text box.

    The following displays in the SQL Select Statement text box:

    SELECT  parcel_no, owner, house_num ,str_name
    FROM  parcel
    WHERE  parc_value >= 50000  AND 
    parc_area >=  100000 

    The query in the SQL Select Statement text box is complete.

  12. Click Execute.

    If Output > Forms is turned on in the Visual SQL Query Builder dialog, clicking Execute generates a dialog form.



    If Output > Browser is turned on in the Visual SQL Query Builder dialog, clicking Execute generates a list (containing the same information as in the dialog form) which is displayed in the Visual SQL Data Browser dialog.