Oracle9i Supplied PL/SQL Packages and Types Reference Release 2 (9.2) Part Number A96612-01 |
|
DBMS_RULE, 2 of 2
Subprogram | Description |
---|---|
Evaluates the rules in the specified rule set that use the evaluation context specified |
Evaluates the rules in the specified rule set that use the evaluation context specified.
Note: Rules in the rule set that use an evaluation context different from the one specified are not considered for evaluation. |
The rules in the rule set are evaluated using the data specified for table_values
, column_values
, variable_values
, and attribute_values
. These values must refer to tables and variables in the specified evaluation context. Otherwise, they are ignored.
The caller may specify, using stop_on_first_hit
, if evaluation must stop as soon as the first TRUE
rule or the first MAYBE
rule (if there are no TRUE
rules) is found.
The caller may also specify, using simple_rules_only
, if only rules that are simple enough to be evaluated fast (which means without SQL) should be considered for evaluation. This makes evaluation faster, but causes rules that cannot be evaluated without SQL to be returned as MAYBE
rules.
Partial evaluation is supported. The EVALUATE
procedure can be called with data for only some of the tables, columns, variables, or attributes. In such a case, rules that cannot be evaluated because of a lack of data are returned as MAYBE
rules, unless they can be determined to be TRUE
or FALSE
based on the values of one or more simple expressions within the rule. For example, given a value of 1
for attribute "a.b"
of variable "x"
, a rule with the following rule condition can be returned as TRUE
, without a value for table "tab"
:
(:x.a.b = 1) or (tab.c > 10)
The results of an evaluation are the following:
TRUE
rules, which is the list of rules that evaluate to TRUE
based on the given data. These rules are returned in the OUT
parameter true_rules
.MAYBE
rules, which is the list of rules that could not be evaluated for one of the following reasons:
"x.a.b"
is specified, but no value is specified for the variable "x"
, the attribute "a"
, or the attribute "a.b"
.simple_rules_only
is specified as TRUE
.MAYBE
rules are returned in the OUT
parameter maybe_rules
.
To run this procedure, a user must meet at least one of the following requirements:
EXECUTE_ON_RULE_SET
privilege on the rule setEXECUTE
_ANY
_RULE
_SET
system privilege
Note: The rules engine does not invoke any actions. An action context can be returned with each returned rule, but the client of the rules engine must invoke any necessary actions. |
See Also:
Chapter 109, "Rule Types" for more information about the types used with the |
DBMS_RULE.EVALUATE( rule_set_name IN VARCHAR2, evaluation_context IN VARCHAR2, event_context IN SYS.RE$NV_LIST DEFAULT NULL, table_values IN SYS.RE$TABLE_VALUE_LIST DEFAULT NULL, column_values IN SYS.RE$COLUMN_VALUE_LIST, variable_values IN SYS.RE$VARIABLE_VALUE_LIST DEFAULT NULL, attribute_values IN SYS.RE$ATTRIBUTE_VALUE_LIST, stop_on_first_hit IN BOOLEAN DEFAULT FALSE, simple_rules_only IN BOOLEAN DEFAULT FALSE, true_rules OUT SYS.RE$RULE_HIT_LIST, maybe_rules OUT SYS.RE$RULE_HIT_LIST);
Note: This procedure is overloaded. One version of this procedure has the |
|
Copyright © 2000, 2002 Oracle Corporation. All Rights Reserved. |
|