This document describes the interface for accessing and using the Visual SQL Editor. Details are available in Visual SQL Editor Functional Specification.
Modify (customize) the SQL query that is bound to a visual component in an application.
Scenario:
Whenever the SQL statement is changed in the VisualSQLEditor, the command property of the RowSet is updated. This is saved as part of the application.
This has been the only means of accessing the VisualSQLEditor in previous versions of Java Studio Creator/VisualWebPack.
Invoke Visual SQL Editor, either starting with no query, or with a context-dependent default query. Use it to create and test queries.
Scenario:
There is no way to save the resulting query.
This is analogous to SQLEditor that is currently accessible from the DB Explorer.
The VSE consists of four panes, positioned vertically on the screen:
The Diagram pane provide an entity-relationship style graphical representation of a SQL query. Nodes of the graph represent tables in the database. Arcs in the graph represent relationships between tables.
The Grid pane provides a spreadsheet representation of a SQL query. Rows in the Grid pane correspond to columns of the database. Only those columns that are selected for output, or otherwise appear in SQL query, will be displayed in the Grid pane. Columns of the Grid pane will contain information relevant to individual database columns, such as whether the column is selected for output, what criteria are applied to the column in the query, and whether the column is used for sorting or grouping.
The SQL pane contains the current SQL query. This is either be generated from the contents of the visual panes, or typed by the user.
The Results pane provides a tabular represention for the results of query execution.
Visual Web Application/Outline Window
| Location | Action | Effect |
|---|---|---|
| RowSet node | RightClick->Edit SQL Statement | Invoke VSE on command property |
Runtime Window / DB Explorer
| Location | Action | Effect |
|---|---|---|
| Table or column node | RightClick->Execute Visual Query | Invoke VSE on default SQL command |
| Location | Action | Effect |
|---|---|---|
| Background | RightClick->Run Query | Execute current query and display results in Result window |
| Background | RightClick->Add Table | Bring up dialog for choosing table(s) to add |
| Background | RightClick->Group By | Add "GROUP BY" clause to query, with all columns from the query output included in the Group By list. |
| Table (titlebar) | RightClick->Remove From Query | Deletes the table from the query |
| Table (column checkbox) | LeftClick | Toggle whether this column is selected for output |
| Table (column name) | LeftClick->Drag to column of another table | Add an equality predicate between the two columns to WHERE clause of query |
| Join arc | LeftClick | Edit the properties of this join in the Properties window |
| Location | Action | Effect |
|---|---|---|
| Any column except Column, Table | LeftClick | Make this row/column active for editing Editing may include: dropdown (Sort Type, Sort Order), Checkbox (Output), Text (Alias, Criteria) |
| Any column | RightClick->Add Query Criteria | Bring up Add Query Criteria dialog for specifying condition on this row/column |
| Location | Action | Effect |
|---|---|---|
| Background | RightClick->Parse Query | Parse current query and update other windows |
| Background | RightClick->Run Query | Execute current query and display results in Result window |
| Location | Action | Effect |
|---|---|---|
| Any cell | RightClick->Copy Cell Value | Copy contents of current cell to clipboard |
| Any cell | RightClick->Copy Row Values | Copy contents of current row to clipboard |