Subject: Problems with "abstime" data type and multiple rules

From: Otago University Database Research Group <[email-masked]>
Date: Mon, 29 Jun 92 17:05:09 -0700

Problems with "abstime" data type

a) "now" does not work from within a rule

    example : define rule history1 is
              on delete to emp
              do append emp_his
              (emp_n=current.emp_n,
               date_gone="now")

always enters into the "date_gone" the same time, perhaps the time the
rule was created, and not the system time the tuple was deleted.

b)  The command :

       retrieve (emp.emp_n)
       where emp.tmin > "now" - "@ 30 days"

does not work. Am I doing something wrong ?

c) The data type "abstime" requires entering the time as well !!
   For example I cannot enter "Jun 17 1990".  Why ?

d) Rules cannot be put into one unix file and later be loaded. They need
   on file each.

e) The rules:
              on retrieve to owner.owncat
               where owner.owncat="PE"
              do instead retrieve (owncat="Person")
    and
               on retrieve to owner.owncat
               where owner.owncat="CO"
              do instead retrieve (owncat="Company")

do not work at the same time.   What is wrong ?

                                            Elikkos Elia
                                          University of Otago
                                          Duinedin - New Zealand

---

From: "Masaki Hirabaru" <[email-masked]>
Date: Tue, 30 Jun 92 12:56:22 +0900

>>    For example I cannot enter "Jun 17 1990".  Why ?

It troubled me too.
So I always put the time, but
2 digits hours, say "Jun 17 12:00:00 1990" couldn't be entered correctly.
Anyway, I fixed the problem. 
I'm not sure my fix is corerct but it works.
I can't wait Version 4.

*** src/utils/adt/date.c.orig	Fri Nov 22 17:36:40 1991
--- src/utils/adt/date.c	Mon Jun  8 12:29:23 1992
***************
*** 906,917 ****
  		p++;
  
  	/* search for hour:minute:sec option */
! 	hour=0;
  	min=0;
  	sec=0;
  	for (i=0; i<=1; i++) {
  	    c = *p;
- 	    hour = -1;
  	    if (isdigit(c)) {
  		if (hour < 0)
  		    hour = (c - '0');
--- 906,916 ----
  		p++;
  
  	/* search for hour:minute:sec option */
! 	hour=-1;
  	min=0;
  	sec=0;
  	for (i=0; i<=1; i++) {
  	    c = *p;
  	    if (isdigit(c)) {
  		if (hour < 0)
  		    hour = (c - '0');

--
Masaki Hirabaru