CREATE RESTRICTION FILTER

Use the CREATE RESTRICTION FILTER command to create a restriction filter.

Syntax

CREATE [ OR REPLACE ] RESTRICTION FILTER filter_name
ON database_name.table_name WHERE condition;

If there is a possibility that a restriction filter already exists with the same name as the one you want to create, use the optional OR REPLACE keywords. If the restriction filter exists, it is replaced by the one you are creating. If the restriction filter does not exist, a new one is created.

Note: If you are replacing an existing restriction filter, only the condition can be changed. A filter can be replaced even if it has been assigned to any users or groups.

The restriction filter name must be unique and comply with the ObjectServer naming conventions.

The table name specified after the ON keyword must be fully qualified with the database name, for example, alerts.status.

The condition consists of one or more expressions that return a subset of rows of the table. Where applicable, you must specify fully-qualified table names within the WHERE clause and any SELECT statements in the condition. Use the format database_name.table_name for a fully-qualified table name.

A restriction filter is always persistent, and is recreated when the ObjectServer restarts.

Example

create restriction filter myfilter on alerts.status where Severity = 5;
Tip: You can also create restriction filters in the Filter Builder.