This chapter describes the types used with rules, rule sets, and evaluation contexts.
This chapter contains the following topics:
Overview
Security Model
This section contains topics that relate to using the types used with rules, rule sets, and evaluation contexts.
This types in this chapter are used in rules and enable clients to evaluate rules with the rules engine.
See Also:
Oracle Streams Extended Examples for examples that use rule types
Type | Description |
---|---|
Specifies the value of a variable attribute |
|
Identifies a list of attribute values |
|
Specifies the value of a table column |
|
Identifies a list of column values |
|
Identifies a list of names |
|
Identifies a list of name-value pairs |
|
Identifies an object containing a list of name-value pairs and methods that operate on this list. This object type is used to represent the event context and the action context for a rule |
|
Identifies a name-value pair |
|
Specifies a rule found because of evaluation |
|
Identifies a list of rules found because of evaluation |
|
Provides the table corresponding to an alias used in a rule evaluation context |
|
Identifies a list of table aliases used in a rule evaluation context |
|
Specifies the value of a table row using a |
|
Identifies a list of table values |
|
Provides the type of a variable used in a rule evaluation context |
|
Identifies a list of variables and their types used in a rule evaluation context |
|
Specifies the value of a variable |
|
Identifies a list of variable values |
Rule types are used with the following Oracle-supplied PL/SQL packages:
DBMS_RULE
DBMS_RULE_ADM
You can use the DBMS_RULE_ADM
package to create and administer rules, rule sets, and evaluation contexts, and you can use the DBMS_RULE
package to evaluate rules.
When you use Oracle Streams, rules determine which changes are captured by a capture process, which messages are propagated by a propagation, which messages are applied by an apply process, and which messages are dequeued by a messaging client. The following Oracle Streams packages use rules:
DBMS_APPLY_ADM
DBMS_CAPTURE_ADM
DBMS_PROPAGATION_ADM
DBMS_STREAMS
DBMS_STREAMS_ADM
DBMS_STREAMS_AUTH
Specifies the value of a variable attribute.
Note:
Enclose the variable name and attribute name in double quotation marks (") if the name contains special characters.TYPE SYS.RE$ATTRIBUTE_VALUE ( variable_name VARCHAR2(32), attribute_name VARCHAR2(4000), attribute_value ANYDATA);
Specifies the value of a table column.
Note:
Enclose the column name in double quotation marks (") if the name contains special characters.TYPE SYS.RE$COLUMN_VALUE ( table_alias VARCHAR2(32), column_name VARCHAR2(4000), column_value ANYDATA);
Identifies an object containing a list of name-value pairs and methods that operate on this list. This object type is used to represent the event context for rule set evaluation and the action context for a rule.
This section describes the following member procedures and member functions of the SYS.RE$NV_LIST
type:
Adds a name-value pair to the list of name-value pairs.
Note:
Enclose the name in double quotation marks (") if the name contains special characters.MEMBER PROCEDURE ADD_PAIR( name IN VARCHAR2, value IN ANYDATA);
MEMBER FUNCTION GET_ALL_NAMES() RETURN SYS.RE$NAME_ARRAY;
Returns the value for the specified name in a name-value pair list.
Note:
Enclose the name in double quotation marks (") if the name contains special characters.MEMBER FUNCTION GET_VALUE( name IN VARCHAR2) RETURN ANYDATA;
Removes the name-value pair with the specified name from the name-value pair list.
Note:
Enclose the name in double quotation marks (") if the name contains special characters.MEMBER PROCEDURE REMOVE_PAIR( name IN VARCHAR2);
Identifies a name-value pair.
Note:
Enclose the name in double quotation marks (") if the name contains special characters.Specifies a rule found because of an evaluation.
See Also:
Table 283-9 RE$RULE_HIT Attributes
Attribute | Description |
---|---|
|
The rule name in the form |
|
The rule action context as specified in the |
Provides the table corresponding to an alias used in a rule evaluation context. A specified table name must satisfy the schema object naming rules.
Note:
Enclose the table name in double quotation marks (") if the name contains special characters.See Also:
Oracle Database SQL Language Reference for information about schema object naming rulesTable 283-10 RE$TABLE_ALIAS Attributes
Attribute | Description |
---|---|
|
The alias used for the table in a rule |
|
The table name referred to by the alias. A synonym can be specified. The table name is resolved in the evaluation context schema. The format is one of the following: schema_name.table_name table_name For example, if the hr.employees |
Identifies a list of table values.
Note:
Each table alias in the list in the list must be unique.Provides the type of a variable used in a rule evaluation context. A specified variable name must satisfy the schema object naming rules.
Note:
Enclose the variable name in double quotation marks (") if the name contains special characters.See Also:
Oracle Database SQL Language Reference for information about schema object naming rulesTYPE SYS.RE$VARIABLE_TYPE ( variable_name VARCHAR2(32), variable_type VARCHAR2(4000), variable_value_function VARCHAR2(228), variable_method_function VARCHAR2(228));
Table 283-12 RE$VARIABLE_TYPE Attributes
Attribute | Description |
---|---|
|
The variable name used in a rule |
|
The type that is resolved in the evaluation context schema. Any valid Oracle built-in datatype, user-defined type, or Oracle-supplied type can be specified. See the Oracle Database SQL Language Reference for more information about these types. |
|
A value function that can be specified for implicit variables. A synonym can be specified. The function name is resolved in the evaluation context schema. It is executed on behalf of the owner of a rule set using the evaluation context or containing a rule that uses the evaluation context. See the "Usage Notes" for more information. |
|
Specifies a value function, which can return the result of a method invocation. Specifying such a function can speed up evaluation, if there are many simple rules that invoke the method on the variable. The function can be a synonym or a remote function. The function name is resolved in the evaluation context schema. It is executed on behalf of the owner of a rule set using the evaluation context or containing a rule that uses the evaluation context. See the "Usage Notes" for more information. |
The functions for both the for the variable_value_function
parameter and variable_method_function
parameter have the following format:
schema_name.package_name.function_name@dblink
Any of the following parts of the format can be omitted: schema_name
, package_name
, and @dblink
.
For example, if the schema_name
is hr
, the package_name
is var_pac
, the function_name
is func_value
, and the dblink
is dbs1.net
, then enter the following:
hr.var_pac.func_value@dbs1.net
The following sections describe the signature of the functions.
Signature for variable_value_function
The function must have the following signature:
FUNCTION variable_value_function_name(
evaluation_context_schema IN VARCHAR2,
evaluation_context_name IN VARCHAR2,
variable_name IN VARCHAR2,
event_context IN SYS.RE$NV_LIST )
RETURN SYS.RE$VARIABLE_VALUE;
Signature for variable_method_function
This function must have the following signature:
FUNCTION variable_method_function_name(
evaluation_context_schema IN VARCHAR2,
evaluation_context_name IN VARCHAR2,
variable_value IN SYS.RE$VARIABLE_VALUE,
method_name IN VARCHAR2,
event_context IN SYS.RE$NV_LIST)
RETURN SYS.RE$ATTRIBUTE_VALUE;
Identifies a list of variables and their types used in a rule evaluation context.