| Andy Hardy 2005-07-24, 7:24 am |
| I've been looking at the DBMS_RULES demo from
http://www.oracle-doku.de/ oracle_1...101/b10727/rule
sdem.htm#1109503 .
The script seems to work fine! It is able to refer to a value added
through the use of 'add_pair'.
However, when I try to encapsulate the script into a package ("rules")
and I try to use a function within the package to provide the implicit
variable I get the ORA-30625.
My evaluation context is created:
l_vt := sys. re$variable_type_lis
t(
sys. re$variable_type('pr
iority'
,'number'
,NULL
,NULL)
,sys. re$variable_type('al
ert_set'
,'varchar2(1)'
,'rules.get_pair_value'
,NULL));
dbms_rule_adm. create_evaluation_co
ntext(
evaluation_context_n
ame => 'evalctx'
,variable_types => l_vt
,evaluation_context_
comment => 'Job priority');
My new rule is:
l_ac := sys.re$nv_list(NULL);
l_ac. add_pair('COLOUR',sy
s.anydata. convertvarchar2('RED
'));
dbms_rule_adm. create_rule(rule_nam
e => 'r4'
,condition => ':alert_set = ''T'' '
,action_context => l_ac
,rule_comment => 'Highlight ALERTS');
My rules.get_pair_value is specified as:
FUNCTION get_pair_value(eco VARCHAR2
,ecn VARCHAR2
,var VARCHAR2
,evctx sys.re$nv_list) RETURN
sys.re$variable_value
but if the function refers to evctx I get the ORA error.
In essence, I want one rule to set a value-pair and for another rule to
use that value-pair i.e. the ability to read the working set.
Any ideas?
--
Andy Hardy. PGP ID: 0xA62A4849
|