Oracle9i Supplied PL/SQL Packages and Types Reference Release 2 (9.2) Part Number A96612-01 |
|
DBMS_RULE_ADM, 2 of 2
Adds the specified rule to the specified rule set.
To run this procedure, a user must meet at least one of the following requirements:
ALTER_ON_RULE_SET
privilege on the rule setALTER
_ANY
_RULE
_SET
system privilegeAlso, the rule set owner must meet at least one of the following requirements:
If the rule has no evaluation context and no evaluation context is specified when you run this procedure, then rule uses the evaluation context associated with the rule set. In such a case, the rule owner must have the necessary privileges on all the base objects accessed by the rule using the evaluation context.
If an evaluation context is specified, then the rule set owner must meet at least one of the following requirements:
EXECUTE_ON_EVALUATION_CONTEXT
privilege on the evaluation contextEXECUTE_ANY_EVALUATION_CONTEXT
system privilege, and the owner of the evaluation context must not be SYS
If the evaluation context owner is different than the rule owner, then the rule owner must have the necessary privileges on all the base objects accessed by the rule using the evaluation context.
DBMS_RULE_ADM.ADD_RULE( rule_name IN VARCHAR2, rule_set_name IN VARCHAR2, evaluation_context IN VARCHAR2 DEFAULT NULL, rule_comment IN VARCHAR2 DEFAULT NULL);
Changes one or more aspects of the specified rule.
To run this procedure, a user must meet at least one of the following requirements:
ALTER_ON_RULE
privilege on the ruleALTER
_ANY
_RULE
system privilegeIf an evaluation context is specified, then the rule owner must meet at least one of the following requirements:
EXECUTE_ON_EVALUATION_CONTEXT
privilege on the evaluation contextEXECUTE_ANY_EVALUATION_CONTEXT
system privilege, and the owner of the evaluation context must not be SYS
If the evaluation context owner is different than the rule owner, then the rule owner must have the necessary privileges on all the base objects accessed by the rule using the evaluation context.
See Also:
Chapter 109, "Rule Types" for more information about the types used with the |
DBMS_RULE_ADM.ALTER_RULE( rule_name IN VARCHAR2, condition IN VARCHAR2 DEFAULT NULL, evaluation_context IN VARCHAR2 DEFAULT NULL, remove_evaluation_context IN BOOLEAN DEFAULT FALSE, action_context IN SYS.RE$NV_LIST DEFAULT NULL, remove_action_context IN BOOLEAN DEFAULT FALSE, rule_comment IN VARCHAR2 DEFAULT NULL, remove_rule_comment IN BOOLEAN DEFAULT FALSE);
Creates a rule evaluation context. A rule evaluation context defines external data that can be referenced in rule conditions. The external data can either exist as variables or as table data.
To run this procedure, a user must meet at least one of the following requirements:
CREATE_EVALUATION_CONTEXT_OBJ
system privilegeCREATE
_ANY
_EVALUATION
_CONTEXT
system privilege
See Also:
Chapter 109, "Rule Types" for more information about the types used with the |
DBMS_RULE_ADM.CREATE_EVALUATION_CONTEXT( evaluation_context_name IN VARCHAR2, table_aliases IN SYS.RE$TABLE_ALIAS_LIST DEFAULT NULL, variable_types IN SYS.RE$VARIABLE_TYPE_LIST DEFAULT NULL, evaluation_function IN VARCHAR2 DEFAULT NULL, evaluation_context_comment IN VARCHAR2 DEFAULT NULL);
Parameter | Description |
---|---|
|
The name of the evaluation context you are creating, specified as For example, to create an evaluation context named |
|
Table aliases that specify the tables in an evaluation context. The table aliases can be used to reference tables in rule conditions. |
|
A list of variables containing the explicit and implicit variables for the evaluation context |
|
An optional function that will be called to evaluate rules using the evaluation context. It must have the same form as the See "Usage Notes" for more information about the evaluation function. |
|
An optional description of the rule evaluation context. |
The evaluation function must have the following signature:
FUNCTION evaluation_function_name( 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 DEFAULT NULL, variable_values IN SYS.RE$VARIABLE_VALUE_LIST DEFAULT NULL, attribute_values IN SYS.RE$ATTRIBUTE_VALUE_LIST DEFAULT NULL, 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); RETURN BINARY_INTEGER;
Note: Each parameter is required and must have the specified datatype. However, you can change the names of the parameters. |
The return value of the function must be one of the following:
Creates a rule.
To run this procedure, a user must meet at least one of the following requirements:
CREATE_RULE_OBJ
system privilege.CREATE
_ANY
_RULE
system privilege.If an evaluation context is specified, then the rule owner must meet at least one of the following requirements:
EXECUTE_ON_EVALUATION_CONTEXT
privilege on the evaluation contextEXECUTE_ANY_EVALUATION_CONTEXT
system privilege, and the owner of the evaluation context must not be SYS
.If the evaluation context owner is different than the rule owner, then the rule owner must have the necessary privileges on all the base objects accessed by the rule using the evaluation context.
See Also:
Chapter 109, "Rule Types" for more information about the types used with the |
DBMS_RULE_ADM.CREATE_RULE( rule_name IN VARCHAR2, condition IN VARCHAR2, evaluation_context IN VARCHAR2 DEFAULT NULL, action_context IN SYS.RE$NV_LIST DEFAULT NULL, rule_comment IN VARCHAR2 DEFAULT NULL);
Creates a rule set.
To run this procedure, a user must meet at least one of the following requirements:
CREATE_RULE_SET_OBJ
system privilegeCREATE
_ANY
_RULE
_SET
system privilegeIf an evaluation context is specified, then the rule set owner must meet at least one of the following requirements:
EXECUTE_ON_EVALUATION_CONTEXT
privilege on the evaluation contextEXECUTE_ANY_EVALUATION_CONTEXT
system privilege, and the owner of the evaluation context must not be SYS
DBMS_RULE_ADM.CREATE_RULE_SET( rule_set_name IN VARCHAR2, evaluation_context IN VARCHAR2 DEFAULT NULL, rule_set_comment IN VARCHAR2 DEFAULT NULL);
Drops a rule evaluation context.
To run this procedure, a user must meet at least one of the following requirements:
DBMS_RULE_ADM.DROP_EVALUATION_CONTEXT( evaluation_context_name IN VARCHAR2, force IN BOOLEAN DEFAULT false);
Drops a rule.
To run this procedure, a user must meet at least one of the following requirements:
DBMS_RULE_ADM.DROP_RULE( rule_name IN VARCHAR2, force IN BOOLEAN DEFAULT false);
Drops a rule set.
To run this procedure, a user must meet at least one of the following requirements:
DBMS_RULE_ADM.DROP_RULE_SET( rule_set_name IN VARCHAR2, delete_rules IN BOOLEAN DEFAULT false);
Grants the specified object privilege on the specified object to the specified user or role. If a user owns the object, then the user automatically is granted all privileges on the object, with grant option.
To run this procedure, a user must meet at least one of the following requirements:
In addition, if the object is a rule set, then the user must have EXECUTE
privilege on all the rules in the rule set with grant option or must own the rules in the rule set.
DBMS_RULE_ADM.GRANT_OBJECT_PRIVILEGE( privilege IN BINARY_INTEGER, object_name IN VARCHAR2, grantee IN VARCHAR2, grant_option IN BOOLEAN DEFAULT false);
Parameter | Description |
---|---|
|
The name of the object privilege to grant to the grantee on the object. See "Usage Notes" for the available object privileges. |
|
The name of the object for which you are granting the privilege to the grantee, specified as |
|
The name of the user or role for which the privilege is granted. The specified user cannot be the owner of the object. |
|
If If |
Table 64-11 lists the object privileges.
For example, to grant the hr
user the privilege to alter a rule named hr_dml
in the strmadmin
schema, enter the following:
BEGIN DBMS_RULE_ADM.GRANT_OBJECT_PRIVILEGE( privilege => SYS.DBMS_RULE_ADM.ALTER_ON_RULE, object_name => 'strmadmin.hr_dml', grantee => 'hr', grant_option => false); END; /
Grants the specified system privilege to the specified user or role.
DBMS_RULE_ADM.GRANT_SYSTEM_PRIVILEGE( privilege IN BINARY_INTEGER, grantee IN VARCHAR2, grant_option IN BOOLEAN DEFAULT false);
Parameter | Description |
---|---|
|
The name of the system privilege to grant to the grantee. See "Usage Notes" for the available system privileges. |
|
The name of the user or role for which the privilege is granted |
|
If If |
Table 64-13 lists the system privileges.
For example, to grant the strmadmin
user the privilege to create a rule set in any schema, enter the following:
BEGIN DBMS_RULE_ADM.GRANT_SYSTEM_PRIVILEGE( privilege => SYS.DBMS_RULE_ADM.CREATE_ANY_RULE_SET, grantee => 'strmadmin', grant_option => false); END; /
Removes the specified rule from the specified rule set.
To run this procedure, a user must meet at least one of the following requirements:
ALTER_ON_RULE_SET
privilege on the rule setALTER
_ANY
_RULE
_SET
system privilegeDBMS_RULE_ADM.REMOVE_RULE( rule_name IN VARCHAR2, rule_set_name IN VARCHAR2, evaluation_context IN VARCHAR2 DEFAULT NULL, all_evaluation_contexts IN BOOLEAN DEFAULT false);
Revokes the specified object privilege on the specified object from the specified user or role.
DBMS_RULE_ADM.REVOKE_OBJECT_PRIVILEGE( privilege IN BINARY_INTEGER, object_name IN VARCHAR2, revokee IN VARCHAR2);
Parameter | Description |
---|---|
|
The name of the object privilege on the object to revoke from the revokee. See "GRANT_OBJECT_PRIVILEGE Procedure" for a list of the object privileges. |
|
The name of the object for which you are revoking the privilege from the revokee, specified as |
|
The name of the user or role from which the privilege is revoked. The user who owns the object cannot be specified. |
Revokes the specified system privilege from the specified user or role.
DBMS_RULE_ADM.REVOKE_SYSTEM_PRIVILEGE( privilege IN BINARY_INTEGER, revokee IN VARCHAR2);
Parameter | Description |
---|---|
|
The name of the system privilege to revoke from the revokee. See "GRANT_SYSTEM_PRIVILEGE Procedure" for a list of the system privileges. |
|
The name of the user or role from which the privilege is revoked |
|
Copyright © 2000, 2002 Oracle Corporation. All Rights Reserved. |
|