Oracle® Database Application Developer's Guide - Expression Filter 10g Release 1 (10.1) Part Number B10821-01 |
|
|
View PDF |
The Expression Filter feature uses 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. These objects are created with the EXF$
prefix and are maintained using the Expression Filter APIs. The user should not modify these objects.
The Expression Filter maintains the concept of an attribute set through an object type with a matching name. The object type used for an attribute set may not contain any user methods, and it should not be an evolved type (with the use of ALTER TYPE
command). If the attribute set is not created from an existing object type, Expression Filter creates the object type with the matching name and maintains it throughout the life of the attribute set. 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 creates 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 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 1:
-- 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;
You should not modify the object type used to maintain an attribute set with the ALTER TYPE
or CREATE OR REPLACE
TYPE
commands. System triggers are used to restrict you from modifying these objects.
When an Expression column is created by assigning an attribute set to a VARCHAR2
column in a user table, a BEFORE ROW
trigger is created on the table. This trigger is used to invoke the expression validation routines when a new expression is added or an existing expression is modified. This trigger is always created 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 2.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, to drop the attribute set and associated metadata when the user is dropped with a CASCADE
option, and to 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.