Subject: Re: [[email-masked]: death]

From: [email-masked]
Date: Wed, 31 Mar 93 14:46:34 -0800

> remove rewrite rule sharon_too_much
> destroy emp
> create emp (location=point,age=int4,name=char16,salary=int4,manager=char16,de
pt=char16)
> append emp(location="(11,10)"::point,age=20,name="bill",salary=1000,manager="
sharon",dept="toy")
> append emp(location="(11,10)"::point,age=31,name="carole",salary=6000,manager
="sharon",dept="toy")
> append emp(location="(15,12)"::point,age=25,name="sharon",salary=500,manager=
"sam",dept="shoe")
> append emp(location="(10,5)"::point,age=30,name="sam",salary=300,manager="bil
l",dept="candy")
> define rewrite rule sharon_too_much is on replace to emp.salary where current
.name="sharon" and new.salary > emp.salary and emp.name = current.manager do in
stead replace emp (salary=current.salary) where current.name="sharon"
> replace emp (salary=500) where emp.name="sharon"
> 

this rewrite rule should loop, but would get shut down due to the
number of loop invocations (i don't remember if i built in code to
give up on extreme numbers of rule invocations)

this rule declares on replace rule to 'emp.salary'. with an event
qualifier.

warning: my memory is very fuzzy on this:

event qualifiers don't work (except maybe for retrieves).  and it
explicitly says so somewhere.  or they don't work for retrieves or for
updates.  anyway this used to be stated somewhere.  

more importantly the action of this rule will trigger the rule again.
endlessly.

later,
Adam

---

From: [email-masked]
Date: Wed, 31 Mar 93 14:46:34 -0800

pt=char16)
sharon",dept="toy")
="sharon",dept="toy")
"sam",dept="shoe")
l",dept="candy")

later,
Adam