head     1.4;
branch   ;
access   ;
symbols  ;
locks    ; strict;
comment  @# @;


1.4
date     91.03.19.15.52.15;  author kemnitz;  state Exp;
branches ;
next     1.3;

1.3
date     91.03.19.15.09.02;  author kemnitz;  state Exp;
branches ;
next     1.2;

1.2
date     91.03.19.15.06.16;  author sp;  state Exp;
branches ;
next     1.1;

1.1
date     91.03.19.00.25.14;  author kemnitz;  state Exp;
branches ;
next     ;


desc
@@


1.4
log
@demo shuffling
@
text
@/*
 * functions can be added and dropped on the fly
 */
 
remove function manager_2
\g
remove function residents_2
\g
@


1.3
log
@reorganized demo scripts
@
text
@d2 1
a2 1
 * and update a newly added instance
d4 5
a8 2
replace emp1 (salary = 2500) where emp1.name = "joe" and emp1.dept = "shoe"
\p
@


1.2
log
@the rules used to implement a version
@
text
@d2 1
a2 1
 * The view definition is expanded to the following commands:
d4 1
a4 3

create emp2(salary = int4, dept = char16,
		location = point, age = int4, name = char16)
a5 45
\r
create emp2_added(salary = int4, dept = char16,
		location = point, age = int4, name = char16)
\p
\r
create emp2_del(DOID = oid)
\p
\r
define rewrite rule emp2_retrieve is on retrieve to emp2 do instead
retrieve(emp2_1.oid, emp2_1.all)
from _emp in emp, emp2_1 in (emp2_added | _emp)
where _emp.oid !!= "emp2_del.DOID"
\p
\r
define rewrite rule emp2_append is on append to emp2 do instead
append emp2_added(salary = new.salary, dept = new.dept,
		location = new.location, age = new.age, name = new.name)
\p
\r
define rewrite rule emp2_delete1 is on delete to emp2 do
delete emp2_added where current.oid = emp2_added.oid
\p
\r
define rewrite rule emp2_delete2 is on delete to emp2 do instead
append emp2_del(DOID = current.oid) where current.oid = emp.oid
\p
\r
define rewrite rule emp2_replace1 is on replace to emp2 do
replace emp2_added(salary = new.salary, dept = new.dept,
		location = new.location, age = new.age, name = new.name)
where current.oid = emp2_added.oid
\p
\r
define rewrite rule emp2_replace2 is on replace to emp2 do
append emp2_del(DOID = current.oid) where current.oid = emp.oid
\p
\r
define rewrite rule emp2_replace3 is on replace to emp2 do instead
append emp2_added(salary = new.salary, dept = new.dept,
		location = new.location, age = new.age, name = new.name)
where current.oid !!= "emp2_added.oid" and current.oid = emp.oid
\p
\r


@


1.1
log
@Initial revision
@
text
@d2 1
a2 1
 * here's the actual rule -- it won't actually be run
d5 2
a6 4
define rewrite rule example_6
on retrieve to emp1
then do instead
retrieve (emp.all) where emp.oid notin {minus.doid}
d9 2
a10 1
retrieve (plus.all)
d13 40
@
