Objects in the SQL Outline view

You can view the relationships in your code between the following objects. You can also perform a number of actions on these objects for further insight into these relationships.

Column

A column that an SQL statement refers to.

What happens when you select a column in the SQL Outline view
The properties of the column that are specifically relevant to pureQuery appear in the Properties view. These properties are:
  • Column Name
  • Schema Name
  • Table Name
What happens when you double-click a column in the SQL Outline view
The full set of properties of the column appears in the Properties view.
Also, the workbench highlights the column in the Data Source Explorer.
What options appear when you right-click a column in the SQL Outline view
Find in Physical Data Model
If the column is used in a physical data model and is associated with an atomic domain that has a privacy policy, this option shows the column in that physical data model in the Data Project Explorer.
For information about marking data types as private, see Adding data privacy information to domain data types.
Show in Data Source Explorer
Causes the workbench to highlight the column in the Data Source Explorer.

Database table

A table that an SQL statement refers to.

What happens when you select a database table in the SQL Outline view
The properties of the table that are specifically relevant to pureQuery appear in the Properties view. These properties are:
  • Schema Name
  • Table Name
What happens when you double-click a database table in the SQL Outline view
The full set of properties of the table appears in the Properties view.
Also, the workbench highlights the table in the Data Source Explorer.
What option appears when you right-click a database table in the SQL Outline view
The option Show in Data Source Explorer on the right-click menu causes the workbench to highlight the table in the Data Source Explorer.

DB2 package

A DB2® package that exists on the DB2 database or that pureQuery is proposing that you create.

What happens when you select a DB2 package in the SQL Outline view
The properties of the DB2 package that are specifically relevant to pureQuery appear in the Properties view. These properties are:
Collection ID
The collection in which the package is located.
Consistency Token
The timestamp for when the package was created.
Root Package Name
The root name that you specified for all of the packages that contain the same set of SQL statements. For example, you might have created one package for each of the isolation levels. Each package would contain the same SQL statements, but the name of each would be the root name and a number that indicates the isolation level.
Version ID
The version that you specified or that was generated automatically for the package.
What happens when you double-click a DB2 package in the SQL Outline view
If the DB2 package exists on the connected database, the full set of properties of the table appear in the Properties view.
In the Data Source Explorer, the workbench highlights the packages that exist for all of the isolation levels that were specified in the Default.bindProps file when you started the bind operation.

The SQL Outline view is indifferent to isolation levels for DB2 packages. It displays packages by their root name only.

What options appear when you right-click a DB2 package in the SQL Outline view
Bind
For DB2 data sources: Runs the StaticBinder utility to bind the SQL statements in the package. Before you select this option, in the Default.bindProps file for your Java™ project specify bind options for the annotated-method interface, implementation class for such an interface, or the pureQueryXML file in which the SQL statements are located.

Besides binding the package, the workbench displays in the Console view the command that it sends to the StaticBinder utility. You can copy the command if you want to run it from a command line with the StaticBinder utility at a later time.

For information about using the Default.bindProps file in your project, see these topics:
Show in Data Source Explorer
Causes the workbench to highlight in the Data Source Explorer the packages that exist for all of the isolation levels that were specified in the Default.bindProps file when you started the bind operation.

Java file

A Java class file or source file that contains the related SQL statement.

What happens when you select a Java file in the SQL Outline view
The following properties of the file appear in the Properties view:
File Name
The name of the Java class file or source file.
IsNative
Indicates whether the implementation of the method is written in Java or another programming language. If the value is TRUE, then the method is not written in Java and the workbench cannot determine the line number at which the SQL statement appears in the Java file.
Java Package
The name of the Java package in which the file appears.
Method Name
The name of the method in the Java file that runs the corresponding SQL statement.
Source Location
The location of the source file within your project.
What happens when you double-click a Java file in the SQL Outline view
If the source file exists in your project, the file opens in an editor in the workbench. The text cursor is positioned on the line where the first related SQL statement appears.
What options appear when you right-click a Java file in the SQL Outline view
Show in SQL Editor
In the SQL editor, displays all of the SQL statements that are in the class file or source file.
Export SQL to File
Lets you save in an .sql file all of the SQL statements that are in the class file or source file.

Java package

A Java package in a project in your workspace.

What happens when you select a Java package in the SQL Outline view
The name of the package appears in the Properties view.
What happens when you double-click a Java package in the SQL Outline view
The first Java file that appears in the hierarchy below the package opens in an editor. The text cursor appears next to the first SQL statement that appears in the hierarchy below the Java file.
What option appears when you right-click a Java package in the SQL Outline view
The option Show in Source appears on the context menu. If you select it, the first Java file that appears in the hierarchy below the package opens in an editor. The text cursor appears next to the first SQL statement that appears in the hierarchy below the Java file.

Project

An open project with pureQuery support that appears in your workspace. Closed projects and projects without pureQuery support do not appear in the view.

Schema

A schema in the connected database.

What happens when you select a database schema in the SQL Outline view
The name of the schema appears in the Properties view.
What happens when you double-click a database schema in the SQL Outline view
The full set of properties of the schema appears in the Properties view.
Also, the workbench highlights the schema in the Data Source Explorer.
What option appears when you right-click a database schema in the SQL Outline view
The option Show in Data Source Explorer on the right-click menu causes the workbench to highlight the schema in the Data Source Explorer.

SQL statement

An SQL statement that is run by the Java application in a project of your workspace.

The SQL statements that appear in the SQL Outline view can be in either of these locations in your application:
  • If you are developing a Java application that uses the pureQuery API, the SQL statement is located in the declaration of an annotated method in an interface.
  • If you are configuring a non-pureQuery API application to run SQL statements statically, or you are configuring an application to run a restricted set of SQL statements dynamically, the SQL statement is located in a Java class file or source file. If you have captured SQL statements for your application, the SQL statement is also located in a pureQueryXML file.
    The SQL Outline view shows all of the points where an application runs an SQL statement. Before you capture SQL statements, the view shows the code that the application uses to run SQL statements. For example, for an application called Department.java, the view might show these entries:
    • Line# 123: getSql()
    • Line# 124: executeQuery()
    • Line# 116: "SELECT " + getColumns2() + getTable()
    • Line# 108: "SELECT " + getColumns() + getTable()
    After you capture SQL statements for this application, the SQL Outline view shows the actual SQL statements that the application runs at those locations. When you then expand an SQL statement, the view shows two stack traces. The first is for the location in the code where the application defines the SQL statement, and the second is for the location in the code where the application runs the statement.

    If you captured SQL statements with the property sqlLiteralSubstitution set to ENABLE, statements that contained literal values appear in the view with parameter markers. For information about this property, see the following topics:

What happens when you select an SQL statement in the SQL Outline view
The SQL statement appears in the Properties view.
If you select the SQL statement when you are viewing the Java page, the Properties view also displays the line number at which the statement is located in the Java file.
What happens when you double-click an SQL statement in the SQL Outline view
If the source file exists in your project, the file opens in an editor in the workbench. The text cursor is positioned on the line where the SQL statement appears.
What options appear when you right-click one SQL statement in the SQL Outline view
Show in Source
If the source file exists in your project, the file opens in an editor in the workbench. The text cursor is positioned on the line where the SQL statement appears.
Run SQL
Runs the SQL statement against the connected DB2 database.
Show in SQL Editor
Opens the SQL statement in the SQL editor.
Export SQL to File
Lets you export the SQL statement to an .sql file.
Open Visual Explain
Opens Visual Explain so that you can examine the access plan for the SQL statement.
For more information about using Visual Explain, see Viewing the access plans for SQL statements.
Get Query Tuner Report
Generates recommendations for tuning the SQL statement, if your configuration meets these prerequisites:
  • If your project is associated with DB2 for Linux®, UNIX®, and Windows®:
    • IBM® Optim™ Query Tuner for DB2 for Linux, UNIX, and Windows must be installed into the same package group as IBM Optim Development Studio.
    • IBM Optim Query Tuner for DB2 for Linux, UNIX, and Windows must be activated on the data server.
    • The data server must be configured for the query tuning client.
  • If your project is associated with DB2 for z/OS®:
    • IBM Optim Query Tuner for DB2 for z/OS must be installed into the same package group as IBM Optim Development Studio.
    • IBM Optim Query Tuner for DB2 for z/OS must be activated on the data server.
    • The data server must be configured for the query tuning client
Open Query Tuner
Opens the Query Tuner editor, if your configuration meets these prerequisites:
  • If your project is associated with DB2 for Linux, UNIX, and Windows:
    • IBM Optim Query Tuner for DB2 for Linux, UNIX, and Windows must be installed into the same package group as IBM Optim Development Studio.
    • IBM Optim Query Tuner for DB2 for Linux, UNIX, and Windows must be activated on the data server.
    • The data server must be configured for the query tuning client.
  • If your project is associated with DB2 for z/OS:
    • IBM Optim Query Tuner for DB2 for z/OS must be installed into the same package group as IBM Optim Development Studio.
    • IBM Optim Query Tuner for DB2 for z/OS must be activated on the data server.
    • The data server must be configured for the query tuning client

See Tuning SQL statements for more information about this feature.

Generate pureQuery Code
Opens the Generate pureQuery Code from an SQL Statement wizard.
Find in pureQueryXML
Opens the pureQueryXML file in which the SQL statement is located and places the cursor at the beginning of the statement.
What options appear when you right-click a selection of two SQL statements in the SQL Outline view
Compare
Shows a comparison of the two statements.
Export SQL to File
Lets you export the SQL statements to an .sql file.
Show in SQL Editor
Opens the SQL statements in the SQL editor.
What options appear when you right-click a selection of two or more SQL statements in the SQL Outline view
Export SQL to File
Lets you export the SQL statements in an .sql file.
Show in SQL Editor
Opens the SQL statements in the SQL editor.

Feedback