Creating and Executing an SQL Query
This procedure describes how you can run an SQL query on your database
once you have created it.
You must have created
a Connection Profile and connected
to your database before using this functionality.
To run an SQL Query on your database:
Open the Database
Development perspective by going to Window
| Open Perspective | Other | Database Development.
Connect to your
Database by following the steps in the Connecting
to a Database topic.
Click the Open
Scrapbook icon on the toolbar.
A new SQL scrapbook will open.
are two ways to write an SQL query:
Writing an SQL query in the scrapbook
(e.g. select * from mytablename;)
the SQL Query Builder which builds your queries using a graphical
in the scrapbook and select Edit in SQL Query builder -or-
press Alt + Q.
The SQL Query Builder will open.
in the left middle pane and select Add table.
the table(s) from which you would like to build your query.
The tables and their columns will be displayed in the pane.
the checkbox of the columns to use in your statement.
can join tables by dragging the cursor between the required
queries -or- right-clicking and selecting Create Join. This
will allow you to retrieve data from two or more tables based
on matching column values.
query will be automatically built and displayed in the top
you have built your query, click OK.
For more information, see '
Query Builder ' in the Data Tools Platform User Documentation .
your query in the scrapbook (e.g. select * from mytablename;)
To execute your
query, right-click anywhere in the editor and select Execute All -or- press Ctrl+Alt+X.
To execute only specified queries, highlight the relevant lines,
right-click and select Execute
query will be run and the results will be displayed in the Result1
tab in the SQL Results view.
The left pane displays the execution history. For each statement
that you execute, including stored procedures, an execution history
entry is added to this pane. This allows you to quickly retest
the execution using slightly different values and settings. You
can rename or delete the launch configurations as needed.
For more information on the Data Tools Platform, please see the Data
Tools Platform User Documentation.