agora inbox for postgres@postgres.berkeley.edu
help / color / mirror / Atom feedFrom: Paul M. Aoki <aoki@postgres.Berkeley.EDU>
To: keen@ms.uky.edu
Cc: postgres@postgres.Berkeley.EDU
Subject: Re: 'retrieve into' in a rule?
Date: Mon, 09 May 94 16:01:46 -0700
Message-ID: <199405092301.QAA29200@faerie.CS.Berkeley.EDU> (raw)
In-Reply-To: <9405091459.aa05728@s.s.ms.uky.edu>
keen@ms.uky.edu writes:
> "define rule r5 is on
> retrieve to emp.age where current.age ISNULL
> do [retrieve into x (emp.all) where emp.dept= current.dept ] \g"
> but when I actually try to retrieve from emp,
> "retrieve (emp.all) \g"
> I get a message that "type x already defined"
> and no tuples are retrieved.
so is this rule run more than once?
you're using the tuple-level rule system, so if there is more
than one emp with null age, the rule will be fired more than
once. of course, once the rule is fired, there's now an "x"
table and any following firings of the rule will blow out the
whole query (because "x" already exists).
seems like you should probably append to x (if you can do so).
--
Paul M. Aoki | CS Div., Dept. of EECS, UCB | aoki@postgres.Berkeley.EDU
| Berkeley, CA 94720 | ...!uunet!ucbvax!aoki
===============================================================================
To add/remove yourself from the POSTGRES mailing list: send mail with
the subject line ADD or DEL to "postgres-request@postgres.Berkeley.EDU"
If this fails, send mail to "post_questions@postgres.Berkeley.EDU" and
a human will deal with it. DO NOT post to the "postgres" mailing list.
===============================================================================
reply
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: postgres@postgres.berkeley.edu
Cc: aoki@postgres.Berkeley.EDU, keen@ms.uky.edu
Subject: Re: 'retrieve into' in a rule?
In-Reply-To: <199405092301.QAA29200@faerie.CS.Berkeley.EDU>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox