| Oracle® Database Application Developer's Guide - Expression Filter 10g Release 1 (10.1) Part Number B10821-01 |
|
|
View PDF |
The Expression Filter DBMS_EXPFIL package contains all the procedures used to manage attribute sets, expression sets, expression indexes, optimizer statistics, and pri vileges. Table 8-1 describes the procedures in the DBMS_EXPFIL package. These procedures are further describe d in this chapter.
All the values and names passed to the procedures defined in the DBMS_EXPFIL package are not case sensitive , unless otherwise mentioned. To preserve the case, you use double quotation marks around the values.
Table 8-1 DBMS_EXPFIL Procedures
| Procedure | Description |
|---|---|
| ADD_ELEMENTARY_ATTRIBUTE | Adds the specified attribute to the attribute set. |
| ADD_FUNCTIONS | Adds a function, type, or package to the approved list of functions with an attribute set. |
| ASSIGN_ATTRIBUTE_SET | Assigns an attribute set to a column storin g expressions. |
| BUILD_EXCEPTIONS_TABLE | < td align="left" headers="r5c1-t2 r1c2-t2">Creates an exception table to hold references to invalid expressions.|
| CLEAR_EXPRSET_STATS | Clears the predicate statistics for an expression set. |
| COPY_ATTRIBUTE_SET | Makes a copy of the attribute set. |
| CREATE_ATTRIBUTE_SET | Creates an attribute set. |
| DEFAULT_IN DEX_PARAMETERS | Assigns default index parameters to an attribute set. |
| DEFAULT_XPINDEX_PARAMETERS | Assigns default XPath index parameters to an attribute set. |
| DEFRAG_INDEX | Rebuilds the bitmap indexes online to reduce fragmentation. |
| DROP_ATTRIBUTE_SET td> | Drops an unused attribute set. |
| GET_EXPRSET_STATS | Collects predicate statistics for an expression set. |
| GRANT_PRIVILEGE | Grants an expression DML privilege to a user. |
| Assigns index param eters to an expression set. | |
| REVOKE_PRIVILEG E | Revokes an expression DML privilege from a user. |
| UNASSIGN_ATTRIBUTE_SET | Brea ks the association between a column storing expressions and the attribute set. |
| VALIDATE_EXPRESSIONS | Validates expression metada ta and the expressions stored in a column. |
| XPINDEX_PARAMETERS | Assigns XPath index parameters to an expression set. |
This procedure adds the specified attribute to the attribute set.
procedure ADD_ELE
MENTARY_ATTRIBUTE (
attr_set IN VARCHAR2, --- attr set name
attr_name IN VARCHAR2,
--- attr name
attr_type IN VARCHAR2); --- attr type
--- or
procedure ADD_ELEMENTARY_ATTRIBUTE (
attr_set IN VARCHAR2, --- attr set name
attr_name IN VARCHAR2, --- table alias (name)
tab_alias IN exf$table_alias); --- table alias for
Arguments
Name of the attribute set to which this attribute is added.
Name of the elementary attribute to be add ed. No two attributes in a set can have the same name.
Datatype of the attribute. This argument accepts any standard SQL datatype or the name of an object type that is accessible to the current user.
The type that identifies the database table to which the attribute is aliased.
Usage Notes
Thi s procedure adds an elementary attribute to an attribute set. If the attribute set was originally created from an existing object typ e, then additional attributes cannot be added.
One or more, or all elementary attributes in an attribute set can be table alia ses. If an elementary attribute is a table alias, then the value assigned to the elementary attribute is a ROWID from the correspondi ng table. An attribute set with one or more table alias attributes cannot be created from an existing object type. For more informati on about table aliases, see Appendix A.
Elementary attributes cannot be added to an attribute set that is already assigned to a column storing expressions.
See "Defining Attribu te Sets" for more information about adding elementary attributes.
Related views: USER_EXPFIL_ATTRIBUTE_SETS and USER_EXPFI L_ATTRIBUTES.
Examp les
The following commands add two elementary attributes to an attribute set:
BE
GIN
DBMS_EXPFIL.ADD_ELEMENTARY_ATTRIBUTE (
attr_set => 'HRAttrSet',
attr_name => 'HRREP',
attr_type => 'VARCHAR2(30)');
DBMS_EXPFIL.ADD_ELEMENTARY_ATTRIBUTE (
attr_set => 'HRAttrSet',
attr_name => 'DEPT',
tab_alias => exf$table_alias('DEPT'));
END;
/
This procedure adds a user-defined fu nction, package, or type representing a set of functions to the attribute set.
PROCEDURE ADD_FUNCTI
ONS (
attr_set IN VARCHAR2, --- attr set name
funcs_name IN VARCHAR2); --- function/package/t
ype name
Argumen ts
Nam e of the attribute set to which the functions are added.
Name of a function, package, or type (representing a function set) or its synonyms.
Usage Notes
By default, an attribute set implicitly allows references to all Oracle supplied SQL functions for use by the expressio n set. If the expression set refers to a user-defined function, the expression set must be explicitly added to the attribute set.
The ADD_FUNCTIONS procedure adds a user-defined function or a package (or type) representing a set of functions to the attribute set. Any new or modified expressions are validated using this list.
The function or the package name can be specified with a s chema extension. If a function name is specified without a schema extension, only such references in the expression set are considere d valid. The expressions in a set can be restricted to use a synonym to a function or a package by adding the corresponding synonym t o the attribute set. This preserves the portability of the expression set to other schemas.
See "Defining Attribute Sets" for more information about adding functions to an attribute set.
Related views: USER _EXPFIL_ATTRIBUTE_SETS and USER_EXPFIL_ASET_FUNCTIONS
Examples
The following commands add two functions to the attribute set:
BEGIN
DBMS_EXPFIL.ADD_FUNCTIONS (attr_set => 'Car4Sale',
funcs_name
=> 'HorsePower');
DBMS_EXPFIL.ADD_FUNCTIONS (attr_set => 'Car4Sale',
funcs_name => 'Scott.
CrashTestRating');
END;
/
This procedure assigns an attribute set to a VARCHAR2 column in a user table to create an
Expression column.
Format
PROCEDURE ASSIGN_ATTRIBUTE_SET (
attr_set IN VARCHAR2, ---
attr set name
expr_tab IN VARCHAR2, --- name of the table
expr_col IN VARCHAR2, --- exp col
umn in the table
force IN VARCHAR2 --- to use existing expressions
default 'FALSE'
);
Arguments
The name of the attribute set.
The table storing the expression set.
The column in the table that stores the expressions.
Argument used to trust the existing expressions in a table (and skip validation).
Usage Notes
The ASSIGN_ATTRIBUTE_SET procedure assigns an attribute set to a VARCHAR2 column in a user table to c
reate an Expression column. The attribute set contains the elementary attribute names and their datatypes and any functions used in t
he expressions. The attribute set is used by the Expression column to validate changes and additions to the expression set.
An attribute set can be assigned only to a table column in the same schema as the attribute set. An attribute set can be assigned to on e or more table columns. Assigning an attribute set to a column storing expressions implicitly creates methods for the associated obj ect type. For this operation to succeed, the object type cannot have any dependent objects before the attribute set is assigned.
By default, the column should not have any expressions at the time of association. However, if the values in the column are known
to be valid expressions, you can use a value of 'TRUE' for the force argument to assign the attribute set t
o a column containing expressions.
See "Defining Expression Columns" for more in formation about adding elementary attributes.
Related views: USER_EXPFIL_ATTRIBUTE_SETS and USER_EXPFIL_EXPRESSION_SETS
Examples< /p>
The following command assigns the attribute set to a column storing expressions. The expression set should be empty at the tim e of association.
BEGIN
DBMS_EXPFIL.ASSIGN_ATTRIBUTE_SET (attr_set => 'Car4Sale',
expr_tab => 'Consumer',
expr_col => 'Interest');
END;
/
This pro cedure creates the exception table, used in validation, in the current schema.
PROCEDURE BUILD_EXCE
PTIONS_TABLE (
exception_tab IN VARCHAR2); -- exception table to be created --
Arguments
Name of the exception table.
Usage Notes
The expressions stored in a table column can be validated using the VALIDATE_EXPRESSIONS procedure. During expression valida tion, you can optionally provide the name of the exception table in which the references to the invalid expressions are stored. The B UILD_EXCEPTIONS_TABLE procedure creates the exception table in the current schema.
See "Evaluation Semantics" and "VALIDATE_EXPRESSIONS Procedure" for more information.
Related view: USER_TABLES
Exampl es
The following command creates the exception table, InterestExceptions, in the current schema:<
/p>
BEGIN
DBMS_EXPFIL.BUILD_EXCEPTIONS_TABLE (
exception_tab => 'Interes
tExceptions');
END;
/
This procedure clears the predicate statistics for the expression set stored in a table column.
PROCEDURE CLEAR_E
XPRSET_STATS (
expr_tab IN VARCHAR2, --- table storing expression set
expr_col IN VARCHAR2);
--- column in the table with set
Arguments
The table storing the expression set.
The column in the table that stores the expressions.
Usage Notes
This procedure cl ears the predicate statistics for the expression set stored in a table column. See also "GET_EXPRSET_STATS Proced ure" for information about gathering the statistics.
Related views: USER_EXPFIL_EXPRESSION_SETS and USER_EXPFIL_EXPRSET_ST ATS
Examples
The following command clears the predicate statistics for the expression set stored in Interest column
of the Consumer table:
BEGIN
DBMS_EXPFIL.CLEAR_EXPRSET_STATS (expr_tab => 'Consumer',
expr_col => 'Interest');
END;
/
This procedure copies an attribute set along with its user- defined function list and default index parameters to another set.
Format
PROCEDURE COPY_ATTRIBUTE_SET (
from_set IN VARCHAR2, --- name of an existing att set
to_set IN VARCHAR2); --- new set name
<
/pre>
Arguments<
/strong>
Name of an ex isting attribute set to be copied.
Name of the new attribute set.
Usage Notes
A schema-extended name can be used for the from_set
argument to copy an attribute set across schemas. The user issuing the command must have EXECUTE privileges for the obje
ct type associated with the original attribute set. The user must ensure that any references to schema objects (user-defined function
s, tables, and embedded objects) are valid in the new schema.
The default index parameters and the user-defined function list of the new set can be changed independent of the original set.
Related views: ALL_EXPFIL_ATTRIBUTE_SETS and ALL_EXPFIL_ATTRIBU TES.
Examples
The following command makes a copy of the Car4Sale attribute set:
BEGIN
DBMS_EXPFIL
.COPY_ATTRIBUTE_SET (from_set => 'Car4Sale',
to_set => 'Vehicle');
END;
/
This procedu re creates an empty attribute set or an attribute set with a complete set of elementary attributes derived from an object type with a matching name.
For mat
PROCEDURE CREATE_ATTRIBUTE_SEt (
attr_set IN VARCHAR2, --- att
r set name
from_type IN VARCHAR2 --- object type for attributes
default 'NO');
Arguments
The name of the attr ibute set to be created.
YES, if the attributes for the attribute set should be derived from an existing object type.
Usage Notes
The object type used for an attribute set cannot contain any user methods, and it should not be an evolved type (with the use of < code>ALTER TYPE command). This object type should not have any dependent objects at the time of the attribute set creation. If the attribute set is not derived from an existing object type, this procedure creates an object type with a matching name.
An attribute set with one or more table alias attributes cannot be derived from an object type. For this purpose, create an empty attri bute set and add one elementary attribute at a time using the DBMS_EXPFIL.ADD_ELEMENTARY_ATTRIBUTE procedure. (See Appendix A for more information.)
See "Defining Attribute Sets" a nd "ADD_ELEMENTARY_ATTRIBUTE Procedure" for more information.
Related views: USER_EXPFIL_ATTRIBUTE_SET and USER_EXPFIL_ATTRIBUTES.
Examples
The following commands create an attribute set with all the required elementary attributes
derived from the Car4Sale type:
CREATE OR REPLACE TYPE Car4Sale AS OBJECT
(Model VARCHAR2(20),
Year NUMBER,
Price NUMBER,
Mileage NUMBER);
/
BEGIN
DBMS_EXPFIL.CREATE_ATTRIBUTE_SET(attr_set =>
'Car4Sale',
from_type => 'YES');
END;
/
Assuming that the Car4Sale t
ype does not exist, the attribute set can be created from scratch as shown in the following example:
BE
GIN
DBMS_EXPFIL.CREATE_ATTRIBUTE_SET(attr_set => 'Car4Sale');
DBMS_EXPFIL.ADD_ELEMENTARY_ATTRIBUTE(
attr_set => 'Car4Sale',
attr_name => 'Model',
attr_type =&
gt; 'VARCHAR2(20)');
DBMS_EXPFIL.ADD_ELEMENTARY_ATTRIBUTE(
attr_set => 'Car4Sale',
attr_name => 'Year',
attr_type => 'NUMBER');
DBMS_EXPFIL.ADD_ELEMENTARY_ATTR
IBUTE(
attr_set => 'Car4Sale',
attr_name => 'Price',
attr_type => 'NUMBER');
DBMS_EXPFIL.ADD_ELEMENTARY_ATTRIBUTE(
attr_set =>
'Car4Sale',
attr_name => 'Mileage',
attr_type => 'NUMBER');
END;
/
This procedure assigns default index parameters to an attribute set. It also adds or drops a partial list of stored and in dexed attributes to or from the default list associated with the attribute list.
PROCEDURE DEFAULT_
INDEX_PARAMETERS (
attr_set IN VARCHAR2, --- attribute set name
attr_list IN EXF$ATTRIBUTE_LIST
,
--- stored and indexed attributes
operation IN VARCHAR2 --- to ADD
or DROP
default 'ADD');
Arguments
The name of the attribute set.
An instance of EXF$ATTRIBUTE_LIST with a partial list of (default)
stored and indexed attributes for an Expression Filter index.
The operation to be performed on the list of index parameters. Default value: ADD. Valid values: ADD and DROP.
Usage Notes
Existing Expression Filter indexes are not modifi ed when the default parameters for the corresponding attribute set are changed. The new index defaults are used when a new Expression Filter index is created and when an existing index is rebuilt. (See ALTER INDEX REBUILD in Chapter 6 for more information about rebuilding indexes.)
See "Cr eating an Index from Default Parameters" for more information about assigning default index parameters to an attribute set.
< p>Related views: USER_EXPFIL_ATTRIBUTE_SETS and USER_EXPFIL_DEF_INDEX_PARAMSExamples
The following command adds the specified st ored and indexed attributes to the attribute set's default index parameters list:
BEGIN
DBMS_EXPFIL.DE
FAULT_INDEX_PARAMETERs(
attr_set => 'Car4Sale',
attr_list => exf$attribute_list (
exf$attribute (attr_name =&g
t; 'Model',
attr_oper => exf$indexoper('='),
attr_indexed => 'TRUE'),
exf$attribute (attr_name => 'Price',
attr_oper => exf$indexoper('all'),
attr_indexed => 'TRUE'),
exf$attribute (attr_name => 'HorsePower(Model, Year)',
attr_oper
=> exf$indexoper('=','<','>','>=','<='),
attr_indexed => 'FALSE'),
exf$attribute (att
r_name => 'CrashTestRating(Model, Year)',
attr_oper => exf$indexoper('=','<','>','>=','<='),
attr_indexed => 'FALSE')),
operation => 'ADD');
END;
/
The following command drops the
CrashTestRating(Model, Year) attribute (stored or indexed) from the previous list.
BEGIN
DBMS_EXPFIL.DEFAULT_INDEX_PARAMETERS(
attr_set => 'Car4Sale',
attr_list => exf$attribute_list (
exf$at
tribute (attr_name => 'CrashTestRating(Model, Year)')),
operation => 'DROP');
END;
/
This procedure adds (or drops) a partial list of XPath parameters to the default index parameters associated with the attribute set.
Format
PROCEDURE DEFAULT_XPINDEX_PARAMETERS (
attr_set IN VARCHAR2, --- attribute set name
xmlt_attr IN VARCHAR2, --- XMLType attrubue name
xptag_list IN EXF$XPATH_TAGS,
--- XPath tags for index
operation
IN VARCHAR2 --- to ADD or DROP
default 'ADD');
<
p>Arguments
The name of the attribute set.
The name of the attribute with the XMLType datatype.
An in
stance of EXF$XPATH_TAGS type with a partial list of XML elements and attributes to be configured for the Expression Fil
ter index.
The operat
ion to be performed on the list of index parameters. Default value: ADD. Valid values: ADD and DROP
code>.
Us age Notes
The attribute set used for an expression set may have one or more XML type attributes (defined with
XMLType datatype) and the corresponding expressions may contain XPath predicates on these attributes. The Expression Fil
ter index created for the expression set can be tuned to process these XPath predicates efficiently by using some XPath-specific inde
x parameters (in addition to some non-XPath index parameters).
The DEFAULT_XPINDEX_PARAMETERS procedure adds (or drops) a part
ial list of XPath parameters to the default index parameters associated with the attribute set. The XPath parameters are assigned to
a specific XMLType attribute in the attribute set and this information can be viewed using the USER_EXPFIL_DEF_INDEX_PAR
AMS view. The DEFAULT_INDEX_PARAMETERS procedure and the DEFAULT_XPINDEX_PARAMETERS procedure can be used independent of each other.
They maintain a common list of default index parameters for the attribute set.
See "Ind ex Tuning for XPath Predicates" for more information about XPath parameters to the default index parameters of an attribute set. See also "DEFAULT_INDEX_PARAMETERS Procedure" for more information about default index parameters.
Rel ated views: USER_EXPFIL_ATTRIBUTES and USER_EXPFIL_DEF_INDEX_PARAMS.
Note:
The values assigned to thetag_name
argument of exf$xpath_tag type are case sensitive.Examples
The following command adds the specified XML tags to the default index parameters list along with their preferences such as positional or value filter and indexed or stored predicate group:
BEGIN
DBMS_EXPFIL.DEFAULT_X
PINDEX_PARAMETERS(
attr_set => 'Car4Sale',
xmlt_attr => 'Details',
xptag_list =>
--- XPath tag list
exf$xpath_tags(
exf$xpath_tag(tag_name => 'stereo@make', --- XML attri
bute
tag_indexed => 'TRUE',
tag_type => 'VARCHAR(15)'), --- value filter
exf$xpath_tag(tag_name => 'stereo', --- XML element
tag_indexed => 'FALSE',
tag_type => null), --- positional filter
exf$xpath_tag(tag_name => 'memory',
--- XML element
tag_indexed => 'TRUE',
tag_type => 'VARCHAR(10)'), --- val
ue filter
exf$xpath_tag(tag_name => 'GPS',
tag_indexed => 'TRUE',
tag_type => null)
)
);
END;
/
The following command drops the stereo@make tag fr
om the default index parameters:
BEGIN
DBMS_EXPFIL.DEFAULT_XPINDEX_PARAMETERS(
attr_set =>
; 'Car4Sale',
xmlt_attr => 'Details',
xptag_list => --- XPath tag list
exf$xpath_tags(
exf$xpath_tag(tag_name => 'stereo@make')
),
operation => 'DROP'
);
END
;
/
This procedure rebuilds the bitmap indexes online and thus reduces the fragmentation.
Format
PROCEDURE DEF
RAG_INDEX (
idx_name IN VARCHAR2); --- expfil index to defrag
Arguments
The name of the Expression Filter index.
Usage Notes
The bitmap indexes defined for the indexed attributes of an Expression Filter index become fragmented as additions and updates ar e made to the expression set. The DEFRAG_INDEX procedure rebuilds the bitmap indexes online and thus reduces the fragmentation.
< p>Indexes can be defragmented when the expression set is being modified. However, you should schedule defragmentation when the worklo ad is relatively light.See "Index Storage and Maintenance" for more information a bout rebuilding indexes.
Related views: USER_EXPFIL_INDEXES and USER_INDEXES.
Examples
The following command is issued to defragment the bitmap indexes associated with the Expression Filter index:
BEGIN DBMS_EXPFIL.DEFRAG_I NDEX (idx_name => 'InterestIndex'); END; /
This procedure drops an attribute set not bein g used for any expression set.
Format
PROCEDURE DROP_ATTRIBUTE_SET (
attr_set IN VARCHAR
2); --- attr set name
Arguments
The name of the attribute set to be dropped.
Usage Notes
The DROP_ATTRIBUTE_SET procedure drops an attribut e set not being used for any expression set. If the attribute set was initially created from an existing object type, the object type remains after dropping the attribute set. Otherwise, the object type is dropped with the attribute set.
Related views: USER_E XPFIL_ATTRIBUTE_SETS and USER_EXPFIL_EXPRESSION_SETS.
Examples
Assuming that the attribute set is not used by an Expression colum n, the following command drops the attribute set:
BEGIN DBMS_EXPFIL.DROP_ATTRIBUTE_SET(attr_set => 'Car4Sale'); END; /
This procedure computes the predicate statistics for an expression set and stores them in the expression filter dictionary.
Format
PROCEDURE GET_EXPRSET_STATS (
expr_tab IN VARCHAR2, --- table sto
ring expression set
expr_col IN VARCHAR2); --- column in the table with set
Arguments
The table storing the expression set.
The column in the table that stor es the expressions.
Usage Notes
When a representative set of expressions are stored in a table column, you can use pred
icate statistics for those expressions to configure the corresponding Expression Filter index (using the TOP parameters
clause). The GET_EXPRSET_STATS procedure computes the predicate statistics for an expression set and stores them in the expression fi
lter dictionary.
See "Creating an Index from Statistics" for more information abou t using predicate statistics.
Related views: USER_EXPFIL_EXPRESSION_SETS and USER_EXPFIL_EXPRSET_STATS.
Examples
The follo
wing command computes the predicate statistics for the expressions stored in the Interest column of the Consumer
code> table:
BEGIN
DBMS_EXPFIL.GET_EXPRSET_STATS (expr_tab => 'Consumer',
expr_col => 'Interest');
END;
/
This procedure grants privileges on one or more Expre ssion columns to other users.
Format
PROCEDURE GRANT_PRIVILEGE (
expr_tab IN VARCHAR2,
--- table w/ the expr column
expr_col IN VARCHAR2, --- column storing the expressions
priv_type
IN VARCHAR2, --- type of priv to be granted
to_user IN VARCHAR2); --- user to which the priv is
--- granted
Arguments
The table storing the expression set.
The column in the table that stores the expressions.
Types of the privilege to be granted. Valid values : INSERT EXPRESSION, UPDATE EXPRESSION, ALL
User to which the privilege is granted.
Usage Notes
The SQL EVALUATE operator evaluat
es expressions with the privileges of the owner of the table that stores the expressions. The privileges of the user issuing the quer
y are not considered. The owner of the table can insert, update, and delete expressions. Other users must have INSERT an
d UPDATE privileges for the table and INSERT EXPRESSION and UPDATE EXPRESSION privilege for a
specific Expression column in the table.
Using the GRANT_PRIVILEGE procedure, the owner of the table can grant INSERT EXPRESSION or UPDATE EXPRESSION privileges on one or more Expression columns to other use
rs. Both the privileges can be granted to a user by specifying ALL for the privilege type.
See "REVOKE_PRIVILEGE Procedure" and "Granting and Revoking Privileges" for more info rmation about granting and revoking privileges.
Related views: USER_EXPFIL_EXPRESSION_SETS and USER_EXPFIL_PRIVILEGES.
Examples p>
The owner of Consumer table can grant INSERT EXPRESSION privileges to user SCOTT
code> with the following command. User SCOTT should also have INSERT privileges on the table so that he can
add new expressions to the set.
BEGIN
DBMS_EXPFIL.GRANT_PRIVILEGE (expr_tab => 'Consumer',
expr_col => 'Interest',
priv_type => 'INSERT EXPRESSION',
to_user => 'SCOTT');
END;
/
This procedure fine-tunes the index parameters for each expression set before in dex creation.
Forma t
PROCEDURE INDEX_PARAMETERS (
expr_tab IN VARCHAR2, --- table wit
h expr column
expr_col IN VARCHAR2, --- column storing expressions
attr_list IN EXF$ATTRIBUTE_L
IST,
operation IN VARCHAR2 --- type of operation
default 'ADD');
Arguments
< dl>The table storing the expre ssion set.
The column in the table that stores the expressions.
An instance of EXF$ATTRIBUTE_LIST with a partial list of stored and indexed attributes.
The operation to be performed on
the list of index parameters. Default value: ADD. Valid values: ADD, DROP, DEFAULT, and CLEAR.
Usage Notes
An attribute set can be used by multiple expression sets stored in different co
lumns of user tables. By default, the index parameters associated with the attribute set are used to define an Expression Filter inde
x on an expression set. If you need to fine-tune the index for each expression set, you can specify a small list of the index paramet
ers in the PARAMETERS clause of the CREATE INDEX statement. However, when an Expression Filter
index uses a large number of index parameters or if the index is configured for XPath predicates, fine-tuning the parameters with th
e CREATE INDEX statement is not possible.
The INDEX_PARAMETERS procedure fine-tunes the index parame ters for each expression set before index creation. This procedure can be used to copy the defaults from the corresponding attribute set and selectively add (or drop) additional index parameters for the expression set. (You use the XPINDEX_PARAMETERS procedure to ad d and drop XPath index parameters.) The Expression Filter index defined for an expression set with a non-empty list of index paramete rs always uses these parameters. The INDEX_PARAMETERS procedure cannot be used when the Expression Filter index is already defined fo r the column storing expressions.
The operations allowed with this procedure include:
Deriving th
e current list of default index parameters (including any XPath-specific parameters) from the corresponding attribute set and assigni
ng them to the specified expression set (a value of DEFAULT for the operation argument).
Ad
ding (or dropping) one or more attributes to (or from) the current list of parameters assigned to the expression set (values of ADD or DROP for the operation argument).
Clearing the index parameters assigned to
the expression set. This enables the user to start using default parameters or tune the parameters from scratch (a value of CLE
AR for the operation argument).
|
|
See "Creating an Index from Exact Parameters" and "XPINDEX_PARAMETERS Procedure" for more information.
Related views: USER_EXPFIL_EXPRESSION_SETS, USER_EXPFIL_DEF_INDEX_PARAMETERS and USER_EXPFIL_INDEX_PARAMETERS.
Examples
The following command synchronizes the expression set 's index parameters with the defaults associated with the corresponding attribute set:
BEGIN
DBMS_EXP
FIL.INDEX_PARAMETERS(expr_tab => 'Consumer',
expr_col => 'Interest',
attr_list => null,
operation => 'DEFAULT');
END;
/
The following command adds a stored attribute to the expression set's index parameters.
BEGIN
DBMS_EXPFIL.INDEX_PARAMETERS(expr_
tab => 'Consumer',
expr_col => 'Interest',
attr_list =>
exf$attribute_list (
exf$attribute (
attr_name => 'CrashTestRating(Model, Year)',
attr_oper => exf$indexoper('all'),
attr_indexed => 'FALSE')),
operation => 'ADD');
END;
/
The fol lowing command clears the index parameters associated with the expression set:
BEGIN
DBMS_EXPFIL.INDE
X_PARAMETERS(expr_tab => 'Consumer',
expr_col => 'Interest',
at
tr_list => null,
operation => 'CLEAR');
END;
/
A subsequent index creation will use the default index parameters assigned to the corresponding attribute set.
This procedure revokes an expression privilege previously granted by the owner.
Format
PROCEDURE REVOKE_PRIVILEGE (
ex
pr_tab IN VARCHAR2, --- table with the expr column
expr_col IN VARCHAR2, --- column storing the expressio
n
priv_type IN VARCHAR2, --- type of privilege to be revoked
from_user IN VARCHAR2); --- user
from which the priv is
--- revoked
Arguments
The table storing the expression set.
The column in the table that stores the expressio ns.
Type of privilege to be revoked.
User from which the privilege is revoked.
Usage Notes
The REVOKE_PRIVILEGE procedure revokes an expression privilege previou sly granted by the owner.
See "GRANT_PRIVILEGE Procedure" and "Granting and Revoking Privileges" for more information about granting and revoking privileges.
Related views: USER_EXPF IL_EXPRESSION_SETS and USER_EXPFIL_PRIVILEGES.
Examples
The following command revokes the INSERT EXPRESSION privileg
e on the Interest column of the Consumer table from user SCOTT:
BEGIN
DBMS_EXPFIL.REVOKE_PRIVILEGE (expr_tab => 'Consumer',
expr_col => 'Interest',
priv_type => 'INSERT EXPRESSION',
from_user => 'SCOTT');
END;/
This procedure unassigns an attribute set from a column storing expressions.
Format
PROCEDURE UNASSIGN_ATT
RIBUTE_SET (
expr_tab IN VARCHAR2, --- table with expr. column
expr_col IN VARCHAR2); --- co
lumn storing expr. set
Arguments
The table storing the expression set.
The column in the table that stores the expressions.
Usage Notes
A column of an expression d
atatype can be converted back to a VARCHAR2 type by unassigning the attribute set. You can unassign an attribute set fro
m a column storing expressions if an Expression Filter index is not defined on the column.
See "ASSIGN_ATT RIBUTE_SET Procedure" for information about assigning attribute sets.
Related views: USER_EXPFIL_EXPRESSION_SETS and USER_ EXPFIL_INDEXES.
Exa mples
The following command unassigns the attribute set previously assigned to the Interest colum
n of the Consumer table. (See Section 5.1.)
BEGIN
D
BMS_EXPFIL.UNASSIGN_ATTRIBUTE_SET (expr_tab => 'Consumer',
expr_col => 'Interest');
END;
/
This procedure validates all the expressions in a set.
Format
PROCEDURE VALIDATE_EXPRESSIONS (
expr_tab IN VARCHAR2, --- expressions table
expr_col IN VARCHAR2, --- column storing expression
s
exception_tab IN VARCHAR2 --- exception table
default null);
Arguments
The table storing the expression set.
The column in the table that stores the expressions.
Name of the exception table. This table is created using the BUILD_EXCEPTIONS_TABLE procedure.
Usage Notes
The e
xpressions stored in a table may have references to schema objects like user-defined functions and tables. When these schema objects
are dropped or modified, the expressions could become invalid and the subsequent evaluation (query with EVALUATE operato
r) could fail.
The VALIDATE_EXPRESSIONS procedure validates all the expressions in a set. By default, the expression validatio n utility fails on the first expression that is invalid. Optionally, the caller can pass an exception table to store references to al l the invalid expressions. In addition to validating expressions in the set, this procedure validates the parameters (stored and inde xed attributes) of the associated index and the approved list of user-defined functions. Any errors in the index parameters or the us er-defined function list are immediately reported to the caller.
See "Evaluation Sem antics" and "BUILD_EXCEPTIONS_TABLE Procedure" for more information.
Related views: USER_EXPFIL_EX PRESSION_SETS, USER_EXPFIL_ASET_FUNCTIONS, and USER_EXPFIL_PREDTAB_ATTRIBUTES.
The following command validates the expre
ssions stored in the Interest column of the Consumer table.
BEGIN
DBMS_EXPF
IL.VALIDATE_EXPRESSIONS (expr_tab => 'Consumer',
expr_col => 'Interest');
END;
/
<
/div>
This pro cedure is used in conjunction with the INDEX_PARAMETERS procedure to fine-tune the XPath-specific index parameters for each expressio n set.
Format
PROCEDURE XPINDEX_PARAMETERS (
expr_tab IN VARCHAR2, --- table with exp
r column
expr_col IN VARCHAR2, --- column storing expressions
xmlt_attr IN VARCHAR2, --- XML
Type attrubue name
xptag_list IN EXF$XPATH_TAGS,
operation IN VARCHAR2 --- to ADD or DROP
default 'ADD');
Arguments
The table storing the expression set.
The column in the table that stores the expressions.
The name of the attribute with the XMLType
datatype.
An instanc
e of EXF$XPATH_TAGS type with a partial list of XML elements and attributes.
The operation to be performed on the list of index parameters. D
efault value: ADD. Valid values: ADD or DROP.
Usage Notes
When an attribute set is shared by multiple expression sets, the INDEX_PARAMETERS procedure can be used to tune the simple (non-XPath) index parameters for each expression set. The XPINDEX_PARAMETERS procedure is used in conjunction with the INDEX_PARAMETERS procedure to fine-tune the XP ath-specific index parameters for each expression set.
See also "INDEX_PARAMETERS Procedure" and "Index Tuning for XPath Predicates" for more information.
Related views: USER_EXPFIL_ATT RIBUTES, USER_EXPFIL_DEF_INDEX_PARAMS, and USER_EXPFIL_INDEX_PARAMS.
Note:
The values assigned to thetag_name
argument of exf$xpath_tag type are case-sensitive.Examples
The following command synchronizes the expression set's index parameters (XPath and non-XPath) with the defaults ass ociated with the corresponding attribute set:
BEGIN
DBMS_EXPFIL.INDEX_PARAMETERS(expr_tab => 'Con
sumer',
expr_col => 'Interest',
attr_list => null,
operation => 'DEFAULT');
END;
/
The following command adds an XPath-specific index parameter to the expression set:
BEGIN
DBMS_EXPFIL.XPINDEX_PARAMETERS(expr_tab => 'Consumer',
expr_col => 'Interest',
xmlt_attr => 'Details',
xptag_list =>
exf$xpath_tags(
exf$xpath_tag(tag_name =
> 'GPS',
tag_indexed => 'TRUE',
tag_type => null)),
operation => 'ADD');
END;
/