MicroStation CONNECT Edition Help

Visual SQL Query Builder Dialog

Used to generate database queries by graphical or visual means, and to generate reusable database form dialogs (obtained from queries) which easily interface with the database.

You can open this dialog from the following:
  • Ribbon: Drawing > Attach > Database > Open Visual Query Builder


SettingDescription
Select tab The Select tab is used to generate the SELECT clause of an SQL database query.
Where tab The Where tab is used to generate a WHERE clause in an SQL database query.
GroupBy tab The GroupBy tab is used to generate a GROUP BY clause in an SQL database query.
OrderBy tab The OrderBy tab is used to sort query results.
SQL Select Statement text box Generates an SQL query statement. A query statement is generated either by using the tab pages and their controls, or by typing directly into the text box.
Execute Generates a form dialog corresponding to the query displayed in the SQL Select Statement text box.
VSQL EXECUTE
Clear All Clears the items selected and closes the Tables dialog.
Clear Text Clears all text in the SQL Select Statement.
VSQL CLEARSQL
Forms > Open Opens the Open Form dialog, a standard file selection dialog, whose default file search filter is .rsc. It is used to open an existing form. After selecting a directory and a file, clicking OK opens the selected form dialog.
VSQL FORMS OPEN
Forms > Save As Opens the Save Form dialog, a standard file selection dialog, whose default file search filter is .rsc. After selecting a directory and typing a filename for the form to be saved, clicking OK saves the open form dialog.
VSQL FORMS SAVEAS
Forms > Exit Closes all the Query Builder dialogs and form dialogs and exits the Query Builder application.
Note: Alternatively, you can dismiss the Visual SQL Query Builder dialog and leave other open VSQL dialogs intact.
Tables > Open Opens the Select Table dialog, which provides a list of database tables for selection for generating SQL queries.
VSQL TABLES OPEN
Queries > Open Opens the Open SQL Query From File dialog, a standard file selection dialog which is preset to select .sql files. This opens a previously saved SQL query which is loaded into the SQL Select Statement text box.
VSQL QUERIES OPEN
Queries > Save Saves the contents of the SQL Select Statement text box in a file.
VSQL QUERIES SAVE
Queries > Save As Opens a dialog which enables you to assign a name to the SQL Select Statement to be saved.
VSQL QUERIES SAVEAS
Queries > Save Results Prompts for a filename where the results of the current SQL Select Statement (dataset) will be saved. Each row of the dataset is saved to a single record in the results file.

The columns are separated by the file extension of the results file:

  • *.txt files separate columns with the pipe "|" character.
  • *.dat files separate columns with the tab "\t" character.
  • *.out files separate columns with a comma.
  • *.dif files separate columns in DIFF format by enclosing each column in double quotes and separating them with columns.
  • *.ins and *.sql files will result in the columns being formatted as a series of SQL Insert statements. This file extension is only permitted for Select statements that include one table only. This format is useful for exporting data in a database-independent SQL format.

Once you choose a format and save your results to a text file, that file can be imported into any program (i.e., word processor, spreadsheet, external database, etc.) that accepts delimited text files.

Another option for saving dataset results to a text file is using the key-in VSQL DATASET WRITE. Saving your query results in this manner allows you to read the dataset from the text file back into MicroStation. When you key in VSQL DATASET READ, your saved results are opened in a dialog, just as they were displayed after executing the original query. If your dataset contains multiple query results, then each set of results within the dataset is displayed in its own dialog.

VSQL DATASET READ <FILENAME
VSQL DATASET WRITE <FILENAME>
VSQL DATASET READ <FILENAME>
Settings > Forms Opens the Standard Form Items dialog, which is used to determine the control items which appear on newly generated dialog forms.

Turn check boxes on and off to select and deselect items, and click OK to save.



VSQL SETTINGS FORMS
Output > Forms Displays the results of your query in a Form dialog.
Output > Browser Displays the results of your query in the Visual SQL Data Browser dialog.