Minimize
Blogger List

Johannes Ahrends
Toad and Oracle

Ben Boise
Toad SC Discussions

Kevin Dalton
Benchmark Factory

Steven Feuerstein
PL/SQL Obsession

Devin Gallagher
Toad SC discussions

Stuart Hodgins
JProbe Discussions

  Henrik "Mauritz" Johnson
Toad Tips & Tricks on the "other" Toads
  Mark Kurtz
Toad SC discussions
  Michael Lumbard
Toad SC discussions
Daniel Norwood
Toad for Data Analysts,
Toad Extension for Visual Studio
Debbie Peabody
Toad for Data Analysts
Gary Piper
Toad Reports Manager
John Pocknell
Toad for Oracle, JProbe
Kuljit Sangha
Toad SC discussions
Bert Scalzo Indicates Oracle ACE status
Toad for Oracle, Data Modeling, Benchmarking
Jeff Smith
Toad product family
Richard To
SQL Optimization
Jim Wankowski
DB2 - LUW and z/OS
John Weathington
  Toad Data Modeler Opens in a new window
Data Modeling
 
  Real Automated Code Testing for Oracle
Quest Code Tester blog
 
Minimize
Blog Tags
toad for oracle (122)
oracle (62)
plsql (46)
sql optimization (37)
toad for data analysts (28)
code tester (19)
toad for ibm db2 (13)
automation (11)
batch optimizer (10)
virtualization (10)
schema browser (9)
toad for sql server (9)
data grid (8)
sql (8)
sql editor (8)
toad data modeler (8)
benchmark factory (7)
excel (7)
query builder (7)
report manager (7)
toad extension (7)
visual studio (7)
11g (6)
configuration (6)
freeware (6)
health check (6)
vmware (6)
connect (5)
dba module (5)
er diagrammer (5)
F4 (5)
linux (5)
refactoring (5)
spotlight (5)
unicode (5)
compare (4)
debugger (4)
export (4)
formatter (4)
make code (4)
rman (4)
strip code (4)
benchmark (3)
bfscript (3)
bulk collect (3)
code templates (3)
code xpert (3)
database browser (3)
db2 (3)
notebook (3)
oem (3)
RAC (3)
session browser (3)
speed (3)
sql optimizer (3)
toad for mysql (3)
tpc-c (3)
9.7 (2)
alert log (2)
app designer (2)
awr (2)
code insight (2)
code snippets (2)
collection (2)
compare and sync (2)
compliance (2)
data generator (2)
data warehouse (2)
database explorer (2)
database monitor (2)
explain (2)
forall (2)
ftp (2)
group execute (2)
handbook (2)
installation (2)
job scheduler (2)
multi-task (2)
nested table (2)
os command (2)
profiler (2)
recovery (2)
release history (2)
save as (2)
schema compare (2)
sql recall (2)
stats pack (2)
subversion (2)
team coding (2)
trace file browser (2)
while loop (2)
10g (1)
64 bit (1)
7zip (1)
action (1)
addm (1)
alter (1)
ansi join (1)
array (1)
ccleaner (1)
code coverage (1)
code road map (1)
CRON (1)
cursor for loop (1)
data browser (1)
data subset (1)
database probe (1)
dbms_flashback (1)
dbms_profiler (1)
ddl (1)
feuerstein (1)
filezilla (1)
flash drive (1)
flow control (1)
for loop (1)
group policy manager (1)
hints (1)
import (1)
index (1)
inheritance (1)
invoker rights (1)
ipad (1)
java (1)
latency (1)
log switch (1)
logical model (1)
ltrim (1)
master-detail browser (1)
monitor (1)
multi-select (1)
naming standards (1)
network (1)
object explorer (1)
OEBS (1)
package (1)
parser (1)
partitioning (1)
performance (1)
pragma (1)
project manager (1)
RAT (1)
revo (1)
REXEC (1)
schema report (1)
script manager (1)
search (1)
set operator (1)
sga (1)
slow (1)
sonarsource (1)
source control (1)
space projection (1)
sql monitor (1)
sql navigator (1)
sql script (1)
sql tracker (1)
sql*plus (1)
standards (1)
statistics (1)
stored procedure (1)
string parser (1)
sub-model (1)
sub-type (1)
synch (1)
synchback (1)
TELNET (1)
toad (1)
trace (1)
unit test (1)
unix (1)
usb (1)
utility (1)
v10 (1)
v9.5 (1)
version control (1)
waits (1)
workload replay (1)
workspace (1)
xml (1)
 
WELCOME, GUEST
 
 

Blogs
Toad and Database Commentaries

Toad World blogs are a mix of insightful how-tos from Quest experts as well as their commentary on experiences with new database technologies.  Have some views of your own to share?  Post your comments!  Note:  Comments are restricted to registered Toad World users.

Do you have a topic that you'd like discussed?  We'd love to hear from you.  Send us your idea for a blog topic.


Jun 21

Written by: Ben Boise
6/21/2009  RssIcon

In Part III of this series of blogs, I’ll discuss the Query Builder in Toad for Data Analysts. In my previous entry, I said that I would talk about both the Editor and the Query Builder in Part III. Both features are so rich that I feel that separating the topics would be the best approach. So, we’ll focus on the Query Builder for this topic. 

As you might have guessed, the Query Builder generates SQL syntax. It’s very similar to Toad for Oracle’s Query Builder, but there are some differences you’ll notice when using the TDA (Toad for Data Analysts) flavor. Let’s get started. 

 
How do I activate the Query Builder?
 
The most direct way is to use the Tools menu and select Query Builder from the list. There are other methods available, but we’ll stick to using the menus. The Query Builder is a drag and drop type of interface. In order to drag and drop objects onto the Query Builder, you must use the Object Explorer window. Remember, this window is located in the bottom portion of the Navigation Manager window.   Activate the Navigation Manager by selecting the View -> Navigation Manager menus.
 

You can drag single objects or multiple objects from the Object Explorer and drop them onto the Query Builder. Use the “Ctrl” key, on your keyboard, to select multiple objects from the Object Explorer. Please note, where referential integrity is defined in the database, the joins between tables will be generated automatically. You can still create your own joins by simply dragging a column from one table to the column of another table. What’s really neat about this approach is the Query Builder allows me to grab tables from different data sources to use in a query. Remember to select the appropriate data source, from the Navigation Manager window, to refresh the Object Explorer’s list of objects. After that, the process is the same. Simply grab the objects from the appropriate data sources and drop them onto the Query Builder. You will need to create your own joins when working with multiple data sources. Depending on the data sources you’re working with, you may see something similar to the below screen shot.

 
 
 
If I need to alter the joins that are displayed in the Query Builder, all I have to do is double-click on the join lines. The join lines are highlighted by the red box in the below screenshot.

This loads a window that allows you to make appropriate adjustments to the join syntax.

 
 
Once you have the objects you wish to use in your query and have adjusted any join statements, simply check the box to the left columns you wish to include in your query. You’ll notice the bottom portion of the Query Builder will start to change.

 

I use the bottom half of the Query Builder to refine my syntax.  It works like a grid. The columns are the columns I’ve selected from the tables and the rows represent different approaches to refining the query. For example, I can create a WHERE condition, on a column, by simply choosing that row for the appropriate column. In this example, we’ll set a WHERE condition on the Balance column. All I have to do is click the Where Condition row in the Balance column.

If I click the ellipsis, I see the following:

For the WHERE condition, I can choose a very straight-forward approach and use the Form tab to build the condition. The Formula tab, while still a graphical approach, gives me access to much more functionality.

This is like switching to Expert mode in Toad for Oracle’s Query Builder! I’ll create my condition and our grid will update.

 
 
Hopefully, you’ve got the gist of refining your queries using this grid approach. Pay particular attention to working with DATE columns. Toad for Data Analysts gives me the ability to create Date Range hints to save myself the trouble of having to constantly update a query with a proper date range (the last 30 days, for example). Check it out.

To see the SQL syntax that’s being generated, you can select the Query tab on the bottom half of the Query Builder.

The Query Builder window now displays the syntax.

If I prefer to work in the Editor, I can right-mouse click (your best friend!) and send the syntax to the Editor by selecting the “Open in Editor” option. I’m not tied to a graphical approach if I like to get my hands dirty .

To execute your query, go to the Query Builder menu and select Execute SQL Statement. You may have noticed a shortcut key listed in this menu. Yes, it’s F9 and it’s the same shortcut key you’re used to in Toad for Oracle.

Our Query Builder window now displays our results.

 
Remember, right-click is your friend. If you right-click on your results data grid, you can see additional functionality, including the ability to Export your results to a variety of formats. 
 
The next topic will cover functionality in the Toad for Data Analysts Editor. I mean it, this time. Have fun!

Search Blog Entries