
Query Editor window
The window appears when you do one of the following:
- In the Catalog Browser, right-click the Queries node, select Add Query from the shortcut menu, input a name for the new query and then click OK.
- In the Catalog Browser, right-click a query and click Edit Query on its shortcut menu.
- In the Catalog Browser, right-click the Business View node, select Add Business View from the shortcut menu, input a name in the displayed dialog and click OK, then in the Add Table/View/Query dialog, add more than one resource to use in the business view and click OK.
- Click Tools > Join Editor or click
on the toolbar in the Business View Editor window.
It helps you to edit a query, or select the table columns and set joins for a business view. See the window.
The following are details about options in the window:
Query Menu
- Apply
Accepts the changes on the query or business view.
- Save As
Saves the query with the name you specify.
- Add Table/View/Query
Opens the Add Table/View/Query dialog to add tables, views, synonyms, queries, imported SQLs, stored procedures, and user defined data sources in the current catalog data source to the query or business view. When a query, imported SQL, stored procedure or user defined data source is added, it will be added as a single table with all of its columns.
- Delete Table/View/Query
Removes the selected resource.
- Union
Creates and modifies a union for the query.
- Filter
Opens the Search Condition dialog to specify more criteria to limit the amount of data.
- Select Distinct
When selected, in the SQL statement, the SELECT DISTINCT command will be used instead of SELECT. The option is enabled when the query contains only tables/views from one JDBC connection.
- Ignore Predicate If Parameter Value Is Null
If the query or business view uses a parameter, and the parameter value is null at runtime, then this condition will be removed from the query's or business view's criterion.
For string type parameters, when the value is left blank, if Ignore Predicate If Parameter Is Null is set to true, the value of this parameter will be considered as NULL, and this predicate will not appear in the WHERE clause; if false, it will be treated as an empty string (¡®¡¯).
- Customized SQL Mode
Specifies whether to use the customized SQL mode, in which JReport will disable all the functions in the Query Editor and you can only edit the query by modifying the SQL statement in the SQL window. The option is enabled when the query contains only tables/views from one JDBC connection.
- Arrange Table/View/Query
Organizes the resources added into the query or business view.
- Show Mapping Names
Specifies to show the full names of the columns in the Query Editor. The option does not affect the contents in the definition.
It is enabled when the query contains only tables/views from one JDBC connection. When it is disabled, the option is treated as checked or true.
- Show Table Names
Specifies to show which table each column belongs to in the criteria panel of the Query Editor.
- Show Paths
Specifies to show information of the pre-join paths among tables in the query, when the pre-join feature is enabled.
- Join Columns
Specifies to join the highlighted columns in tables together.
- Auto Join
Specifies to join tables together based upon the default criteria set in the Options dialog (File > Options > Query Editor > Auto Join). You can also reset the criteria to join tables in the query or business view by checking/unchecking the items on the Auto Join submenu.
- Foreign Keys
Specifies to automatically join tables in the query or business view through a reference from Table A to a primary key in Table B. For example, an order form in Table A shows information on purchases that are made by a customer. It can also show this customer's ID #. The customer ID # refers to a record in Table B which lists a specific address, phone number, name, and so on for the customer. The customer ID # in Table A is a foreign key because it links the customer's ordering information in Table A to the customer's information in Table B.
- Primary Key with Same Names
Specifies to automatically join tables in the query or business view through a field or a combination of fields that uniquely and specifically identifies a record. For example, your credit card number is a primary key because it specifically links to your birthday, credit history, address, and so on.
- Same Column Names
Specifies to automatically join tables in the query or business view through a link between two columns of the same name in two different tables.
- Current Query Options
Opens the Query Option dialog to change Auto Join and showing options.
Column menu
- Create Computed Column
Opens the Create Computed Column dialog to create functions used for a particular query. It helps you to quickly and easily create columns with the functions available instead of writing a formula. The option is enabled when the query contains only tables/views from one JDBC connection.
- Add Formula Field
Opens the Add Formula Field dialog to add formulas to the query or business view.
- Delete Column
Deletes the selected column in the Criteria menu. To undelete, find the field in the table you deleted and place a check mark beside it.
View menu
The following two options are enabled when the query contains only tables/views from one JDBC connection.
- Edit SQL
Shows the SQL statement of the query.
- Preview
Opens the Preview Option dialog to preview the records.
Help menu
- Query Editor Help
Displays the help document about this feature.
Toolbar
The following are commands on the toolbar:
Add Table/View/Query
Opens the Add Table/View/Query dialog to add tables, views, synonyms, queries, imported SQLs, stored procedures, and user defined data sources in the current catalog data source to the query or business view. When a query, imported SQL, stored procedure or user defined data source is added, it will be added as a single table with all of its columns.
Delete Table/View/Query
Removes the selected resource.
Create Computed Column
The create functions are used for a particular query. It helps you to quickly and easily create columns with the functions available instead of writing a formula. The option is enabled when the query contains only tables/views from one JDBC connection.
Add Formula Field
Opens the Add Formula Field dialog to add formulas to the query.
Delete Column
Removes some unwanted columns from a table.
Arrange
Organizes the resources added into the query or business view.
Preview
Opens the Preview Option dialog to preview the records. The option is enabled when the query contains only tables/views from one JDBC connection.
Criteria panel
Lists all columns added to the query. You can specifically define criteria for the columns in this panel.
SQL
Shows the SQL statement of the query.
Show Paths
Shows information of the pre-join paths among tables in the query, when the pre-join feature is enabled.
OK
Accepts all changes and closes the window.
Cancel
Does not retain any changes and closes the window.
Apply
Accepts all changes in the window.
Help
Displays the help document about this feature.
Related topics:
