Specifying global row conditions

In the Query Builder editor, you can specify global row conditions for a visual query.

About this task

The global row conditions affect more than a specific column in the query results. You can use this pane if you want to set a condition that includes the data column that is available in the file, but is not included in the query results.

To specify global row conditions:

Procedure

  1. Click Show Row Conditions and open the Global Conditions pane.
  2. Click Insert Condition.
    The Row Conditions window opens.
  3. If you specify more than one condition that must be met for a row to be included in the query results, you must indicate how each condition is connected in the Connector area.
    • And connector means that the current condition and the previous condition must be met in order for the row to be included.
    • Or connector means that either the current condition or the previous condition can be met in order for the row to be included.
    Tip: When you connect multiple conditions with both And and Or, the rules of the data source determine how the conditions are processed.
  4. In the Left Side area, select a column from the list that you want to use in the conditional expression for adding to the query results.

    This list contains all the columns that are included in the query results. You can filter the listed columns by typing a necessary row name in the text field.

  5. If you want to specify a conditional expression that determines the column, enter an expression in the Or, enter an expression here field.
    1. Click the ellipsis (...) to open an expression builder that can help you build the conditional expression.
      The expression builder offers a palette of common elements that are used to create SQL expressions, such as column names, constants, functions, and operators.
    2. Click the expression builder buttons, templates for expression elements are inserted into the expression fields.
  6. Select the operator for the global row condition expression in the Operator area.
    1. To use the operator as is, select Is.
    2. To change the operator to its negative opposite, click Is Not.

      For example, to specify "Is Not Equal To" click Is Not and select the Equal To operator from the list.

      Important: You cannot use the Starting with, Ending with, or Containing operators if the left and right sides of the row condition expression have numeric data types.
      Important: If IBM Db2 Spatial Extender is installed on the database, you are able to work with spatial data types: points, lines, and polygons. But you cannot use any of the spatial predicates unless the left and right sides have spatial data types.
  7. Specify the condition for which to check the rows in the Right Side area.
    1. You can use the expression builder button to help you build the conditions.
    2. To add row conditions from a file of any format with the values that are separated by commas, click Import Conditions From File.
    3. To specify row conditions from a set of query results, click Import Conditions via Executing SQL Query, and enter the SQL text of a query.
    4. You can use the Remove Condition or Remove All Conditions buttons to remove one or all row conditions.
  8. Click Add.
    The row condition is added and displayed in the Global Conditions pane of the Query Builder editor. Repeat this process for each condition that you want to add.
  9. When you finish specifying each condition, click Close.
  10. In the Global Conditions pane you can do the following actions:
    1. To change the order of the entered conditions, select a condition from the list and click Move Condition Up or Move Condition Down.
    2. To insert a condition before a particular condition, navigate to the required condition, click Insert Condition, and enter the text of the condition in a blank line. The condition is added to the list before the selected one.
    3. To edit a command, select it from the list, click Edit Condition, and change the text of the condition.
    4. To remove a condition, select it from the list, click Remove Condition or delete the text of the condition from the line.