SQL Development
BMC AMI Test Drive
e and Data Management SQL Development
This tutorial will introduce you to the SQL Development in BMC AMI DevX Workbench for Eclipse that enables you to query, create, and manage various database types of data.
Revised: 2024/03/14 00:00
Getting Started
Instructions:
- This guide contains many screenshots to provide a visual reference
- Please note each place that you must enter your own specific ID or number
- You must complete each step before proceeding to the next to successfully follow the test drive script
If, at any point during your experience, your host connection times out, you may need to log back in to the TestDrive host connection.
If at any time during the execution of this script the Common Enterprise Services Login popup is shown, enter your test drive ID and password under User ID and Password, check the Save credentials box and then depress the ENTER key or click OK.
SQL Development
One popular feature in BMC AMI DevX File-AID for DB2 is the SQL Command Manager (option 3.5).
The SQL Development introduces similar capabilities into the BMC AMI DevX Workbench for Eclipse.
Just as the SQL Command Manager leveraged SPUFI, the SQL Development leverages the Eclipse framework called Data Tools. Data Tools generally uses a JDBC connection to connect to an RDBMS. The Workbench implementation does not require a JDBC driver, instead it uses HCI to submit the request and File-AID for DB2 as the back engine.
SQL Development is part of Workbench for Eclipse; the only requirement is File-AID for DB2.
Data Tools can connect to a wide variety of relational databases. Generally, it uses JDBC drivers to complete the SQL request. The behavior is identical, the processing is different. A hybrid programmer, one working across platforms, could use Data Tools within Workbench for Eclipse to connect to other databases like SQL Server, Oracle, or Sybase. The DB2 for z/OS using Topaz is the only connection that BMC AMI DevX supports.
The list of Schema's can be very long at your site. You can filter it by:
- Right click on Schemas
- Select Properties
- Unclick Disable Filters check box
- Enter filter as desired (type filter in uppercase)
Note how there is now an SQL Results tab open. The left-hand side of the SQL Results view shows the results of the commands currently executed. We should have one successful command executed. The right-hand side shows the results (some sample data from the ORDER_TABLE) and, if you click on the Status tab, will show the command executed and the time to complete the request.
The icons on the right side offer some additional controls as to what is displayed.
Using the SQL Scrapbook
Type Ahead Functionality
The SQL Development colorizes SQL keywords and provides type-ahead functionality.
Execute SQL Statements
You now have two successful executions on the left, and the right side shows the Status tab which shows the statement executed and elapsed time.
View Results
You can enter multiple statements in the SQL Scrapbook Editor. Always end the early SQL statements with ";"
The SQL Scrapbook also accepts commands other than SELECT statements.
It returned the expected error from our typo.
The SQL Results view on the left under Status has a drilldown when multiple statements are entered and shows Group Execution under the Operation column.
Clicking on the expanded entries will show their results on the right-hand side.
Using the SQL Query Builder
Create, edit, or run SQL statements using the SQL Query Builder graphical interface, which provides access to your database schema and objects so that you can quickly create or edit SQL statements without needing to type any SQL code. You also have the flexibility to add or modify the SQL code in the editor window.
Table Joins
The SQL Query Builder window opens. For this exercise let's join two tables.
Note that it has already started building the SQL Statement in the top window.
The Create Join window appears and lists the Customer table for both source and target. You will create the join between the two tables based on the Customer Number value.
Note the visual line now connecting the tables. Next select the columns from which to return data.
These columns are now listed in the Columns tab at the bottom of the screen. This has now created the Select statement for these joined tables.
The SQL SELECT statement gets built in the top-most pane. Clicking OK at this point will take this generated SQL statement and append it into the SQL Scrapbook. You can also execute it by right clicking in the top pane and selecting Run SQL.
Your results will show only the selected columns from both tables.
The SQL Statement is brought back into the SQL Scrapbook and can be executed from here as well.
Additional Functionality
Other things to experiment with in the SQL Development.
In the left-hand tree view:
- Right Click on a table and select Generate DDL…
- Right Click on a table and select Data -> Edit
- Right Click on a table and select Data -> Extract
- Right Click on a table and select Data -> Sample Contents. Then from the results pane on the bottom right, try the various icons. Right click in a row and try the various choices.
- Notice how you can export into a .txt file
(Some commands may not be available at this time)
Congratulations! This completes the SQL Development for Db2 tutorial for BMC AMI Test Drive.