J.M.
Dennis is right. You will need an EEP. You are attempting to do a
validation process that involves more than one row in a table and IMHO rules
aren't designed for that purpose. If it turns out they are I will be quite
pleased. As far as I know rules are used to check values in a given row
against each other and against other values in the same or other tables. I
don't think they can be used to check against aggregate values altho you
might try a view which contains the sum in question. It might work.
Bernie
=======================================
At 07:00 PM 2/23/2002 -0500, you wrote:
>
>Hi all,
>
>
>I have a table that contains the components for a receipt.
>Each row contains 3 columns :
>
>Receipt TEXT (8)
>Component TEXT (8)
>Weight_Percentage DOU
>
>Example :
>'Cake','Egg',10.
>'Cake','Butter',25.
>'Cake','Flour',50.
>... and so on.
>
>I am looking for a rule able to prevent user to enter new rows or change
>existing rows such as the sum of Weight-Percentage stay less or equal to
>100 %
>
>I tryed :
>RULES 'Receipt incorrect' FOR composition SUCCEEDS +
> WHERE (100 -Weight_Percentage) >= (SELECT SUM(Weight_Percentage) FROM
>composition T1 +
> WHERE T1.Receipt = composition.Receipt)
>and
>RULES 'Composition incorrecte' FOR composition SUCCEEDS +
> WHERE Receipt NOT IN +
> (SELECT Receipt FROM composition GROUPED BY Receipt +
> HAVING (SUM(Weight_Percentage) > 100))
>without any success ....
>
>Suggestions are welcomes ....
>TIA
>
>J.M. GRATIAS, Logimatique, France
>================================================
>TO SEE MESSAGE POSTING GUIDELINES:
>Send a plain text email to [EMAIL PROTECTED]
>In the message body, put just two words: INTRO rbase-l
>================================================
>TO UNSUBSCRIBE: send a plain text email to [EMAIL PROTECTED]
>In the message body, put just two words: UNSUBSCRIBE rbase-l
>================================================
>TO SEARCH ARCHIVES:
>http://www.mail-archive.com/rbase-l%40sonetmail.com/
>
================================================
TO SEE MESSAGE POSTING GUIDELINES:
Send a plain text email to [EMAIL PROTECTED]
In the message body, put just two words: INTRO rbase-l
================================================
TO UNSUBSCRIBE: send a plain text email to [EMAIL PROTECTED]
In the message body, put just two words: UNSUBSCRIBE rbase-l
================================================
TO SEARCH ARCHIVES:
http://www.mail-archive.com/rbase-l%40sonetmail.com/