Creating and running queries

<< Click to Display Table of Contents >>

Navigation:  User Manual >

Creating and running queries

Previous pageReturn to chapter overviewNext page

 

Creating database queries is done by setting up the relationships between tables in the visual query builder, then clicking an option on the Run Analysis button. With a project open, click on New Query Builder. Then click Object on the main Ribbon Toolbar. You will then be presented with the following screen.

 

QueryBuilderBlank

 

 

See Query Builder in the User Interface Reference for details on Query Builder Panes and Windows.

 

Notice that a new section of the Ribbon toolbar appears called appropriately enough Query Builder.

 

RibbonQueryBuilder

 

The buttons on this toolbar provide for the following functionality.

 

 

Close Global Wait Dialog

 

Close an orphaned Status Screen from a failed query or script

 

 

Save Query Builder / Save Query Builder As

 

Saves the query builder and all schema definitions

 

 

Select Database

 

Invokes the Database Connections dialog. This is where the selection of the database tables to include in the query takes place.

 

 

Run Analysis

 

This is a multi function button. Clicking the top part of the button starts the data retrieval process. Clicking the drop down portion of the button offers additional options to sending the retrieval results to various open windows.Status screens will appear as each aspect of the query is executed.

 

 

Create From Query Results

 

Displays options for sending the retrieved results straight to a CSV file or to an R workspace.

 

 

Preview SQL

 

When toggled on, displays a dialog before the execution of the query showing the actual SQL command to be executed.

 

 

Capitalize Aliases

 

Automatically Capitalizes alias names within the query builder expression pane.

 

 

Generate Data Grid / Dashboard / Analyzer / Report

 

When toggled on, creates the respective object and sets the data to the retrieved Data Table.

 

 

Icon Size

 

Sets the icon size of the icons in the Database List pane.

 

 

Status Counter

 

Sets the value under which the status dialog will report its progress.

 

 

Limit Recs To Top

 

Limits the number of records returned by the query. Note that this value is also used when right clicking on a database in the list and selecting 'View top n records'.

 

 

Auto Size Windows

 

Resizes and repositions all Table Windows such that they fit within the diagram pane,

 

 

Auto Link Tables

 

When toggled on, added tables automatically seek out common fields to link to in other tables within the diagram pane.

 

 

Local Execution

 

Directs Plato Analysis to use its own internal library of functions to set against Table Columns. This will be used when the Expression panel makes us of custom Java functions.

 

 

Debug Query

 

When toggled on, outputs detailed information on steps processed by the query engine.

 

 

 

Click Select Database to include the databases you want to run the query against. The following dialog will then appear.

 

SelectDatabase

 

 

Click on Selected for the Database Profiles that you want the query builder to retrieve schemas for. When you have selected your databases click Connect. You will then see the query builder's right pane display the database and its schema (tables and views).

 

QueryDBList

 

The icons to the left of the database profiles indicate the database type. Each entry includes the source database followed by the user defined connection name in parenthesis. You may expand the tables/view list for each database by clicking on the arrow to the left. At this point the desired table/views are either dragged into the diagram pane or you may simply double click the table/view to add it to the diagram pane.