Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  • Scope - A filter may be applied to a single database table or, if no table is specified, an entire server connection. A filter will constrain the records which are returned by any queries that are issued from the Servoy client to the table(s). A filter takes effect immediately upon being added and remains in effect for the duration of the client session unless programmatically removed. The constraints of a filter apply to all facets of a Servoy solution, including: 
    • foundsets
    • related foundsets
    • value lists
Note

There is are only one way two ways to circumvent a table filter - :
# by issuing a custom SQL query String through the getDataSetByQuery method of the databaseManager API. (Note: the version of getDataSetByQuery that takes a QueryBuilder object as first parameter DOES take into account applicable TableFilters

# by using the rawSQL plugin

Therefore, if one wishes to maintain the effects of a filter, it is important to remember to modify such queries with an appropriate SQL WHERE clause .in case any of the above two cases apply

  • Logical Expression - A filter will contain a logical expression which is evaluated on behalf of records in the filtered table(s). Only records, for which the expression evaluates to true, will be returned by any queries issued to the filtered table(s). At runtime, the filter will be translated into an SQL WHERE clauseand appended to the query of any foundset which is bound to the filtered table(s). An expression contains the following components:
    • Data Provider Name - This is the left-hand operand. It is the name of a single column by which to filter. When filtering an entire server connection, only tables which contain the named column will be filtered.
    • Operator - The following operators are supported 

      =

      Only records whose column equals the specified value

      <

      Only records whose column is less than the specified value

      >

      Only records whose column greater than the specified value

      >=

      Only records whose column greater than or equals the specified value

      <=

      Only records whose column less than or equalsthe specified value

      !=

      Only records whose column does not equal the specified value

      ^

      Only records whose column value is null

      LIKE

      Only records whose column matches using the SQL LIKE construct (use wildcard '%' characters)

      IN

      Only records whose column value is in (using the SQL IN construct) a list of values

      #

      Modifier, used to make case-insensitive queries

      ||

      Modifier used to concatenate two conditions w/ a logical OR

      Note

      Operators and modifiers may be combined, producing more complex conditions. For example #^||!= would translate to: is null OR case-insensitive not equals

    • Data Provider Value - This is the right-hand operand and should evaluate to a literal value to be compared with the named column.

...