Oracle® Database Rules Manager and Expression Filter Developer's Guide 11g Release 2 (11.2) Part Number E14919-01 |
|
|
View PDF |
Expression Filter and Rules Manager features use schema objects to maintain an Expression column in a user table. Most of these objects are created in the schema of the table with the Expression column. Expression Filter creates objects with the EXF$
prefix and Rules Manager creates objects with the RLM$
prefix (). You can use Expression Filter or Rules Manager APIs to maintain these objects. You should not modify these objects.
The Expression Filter maintains the concept of an attribute set through an object type with a matching name, while Rules Manager maintains the concept of an event structure through an object type with a matching name. The object type used for an attribute set or event structure may not contain any user methods, and it should not be an evolved type (with the use of the SQL ALTER TYPE
command). If the attribute set or event structure is not created from an existing object type, Expression Filter or Rules Manager creates the object type with the matching name and maintains it throughout the life of the attribute set or event structure. It also generates functions for the object type for data item management, dynamic expression evaluation, and expression type checking.
In addition to the object type, Expression Filter and Rules Manager create a nested table type of the object type in the same schema. This nested table type uses a namespace EXF$NTT_
n
, and it is used internally for the expression validation.
The object type created for the attribute set or event structure can be used to create a table storing the corresponding data items. Such tables could include a column of the object type or the table itself could be created from the object type. These tables can be joined with the table storing expressions. This is shown in the following example using the application example in Chapter 11:
-- a table of type -- CREATE TABLE CarInventory OF Car4Sale; INSERT INTO CarInventory VALUES ('Mustang',2000, 18000, 22000); INSERT INTO CarInventory VALUES ('Mustang',2000, 18000, 22000); INSERT INTO CarInventory VALUES ('Taurus',1997, 14000, 24500); SELECT * FROM Consumer, CarInventory Car WHERE EVALUATE (Consumer.Interest, Car.getVarchar()) = 1; -- table with the object type column -- CREATE TABLE CarStock (CarId NUMBER, Details Car4Sale); INSERT INTO CarStock VALUES (1, Car4Sale('Mustang',2000, 18000, 22000)); INSERT INTO CarStock VALUES (2, Car4Sale('Mustang',2000, 18000, 22000)); INSERT INTO CarStock VALUES (3, Car4Sale('Taurus',1997, 14000, 24500)); SELECT * FROM Consumer, CarStock Car WHERE EVALUATE (Consumer.Interest, Car.Details.getVarchar()) = 1;
Note:
You should not modify the object type used to maintain an attribute set or event structure with the SQLALTER TYPE
or CREATE OR REPLACE
TYPE
commands. System triggers are used to restrict you from modifying these objects.Section C.2.1, Section C.2.2, and Section C.2.3 describe some Expression Filter specific information about Expression Filter internal objects.
When you create an Expression column by assigning an attribute set to a VARCHAR2
column in a user table, a BEFORE ROW
trigger is created on the table. Expression Filter uses this trigger to invoke the expression validation routines when a new expression is added or an existing expression is modified. Expression Filter always creates this trigger in the EXFSYS
schema, and it uses the EXF$VALIDATE_
n
namespace.
The Expression Filter index defined for a column is maintained using database objects created in the schema in which the index is created. These are described in Section 12.8.
Expression Filter uses system triggers to manage the integrity of the system. These include system triggers to:
Restrict the user from dropping an object type created by an attribute set
Drop the attribute set and associated metadata when the user is dropped with a CASCADE
option
Maintain the Expression Filter dictionary through DROP
and ALTER
operations on the table with one or more Expression columns
These triggers are created in the EXFSYS
schema.