Thanks, Eloen,

I tried your suggestion straight away and I think that the rule works (see
below) - with one change:
I replaced:
T1.Inst_Type = Top10_Performances.Inst_Type
with:
T1.Inst_Type IS NOT NULL

That's a better solution than an (otherwise useless) view but I can still
add more than
10 rows with the same Inst_Type from the browser/editor as long as I don't
leave the editor. As soon as I leave and go back then the rule message
appears when I try to edit where the count is more than 10.

There's a simple work around - run the edit for 1 row at a time in a loop -
but I'd love to know why there appears to be some sort of "delay" in the
count being updated.

Can anybody say whether R:Base updates itself internally between each row
addition or only at the end of an edit command - be it "edit * from ..." or
"edit using [formname]..."? I'd always thought that it would have to be
instant - especially in a multi-user situation.

Would someone mind creating - copy & paste - the simple test DB
below and see if the same result occurs?

SET QUOTES=NULL
SET QUOTES='
SET DELIMIT=NULL
SET DELIMIT=','
SET LINEEND=NULL
SET LINEEND='^'
SET SEMI=NULL
SET SEMI=';'
SET PLUS=NULL
SET PLUS='+'
SET SINGLE=NULL
SET SINGLE='_'
SET MANY=NULL
SET MANY='%'
SET IDQUOTES=NULL
SET IDQUOTES='`'
SET CASE OFF
SET AUTOSKIP OFF
SET REVERSE ON
SET BELL OFF
SET NULL '-0- '
SET TOLERANCE 0.
SET ZERO ON
DISCONNECT
SET STATICDB OFF
SET ROWLOCKS OFF
SET FASTLOCK OFF
CREATE SCHEMA  AUTHOR ADBTEST     PUBLIC
CREATE TABLE `Top10_Performances`  +
(`Inst_Type` TEXT    (1) )
LOAD `Top10_Performances`
NONUM
'a'
'b'
'c'
'a'
'a'
'a'
'z'
'z'
'z'
'z'
'z'
'z'
'z'
'z'
END
RULES 'Fail' +
FOR `Top10_Performances` SUCCEEDS  +
WHERE (NOT Top10_Performances.Inst_Type IN (SELECT Inst_+
Type FROM Top10_Performances T1 WHERE T1.Inst_Type+
 IS NOT NULL) OR Top10_Performances.Inst_Type IN (+
SELECT T2.Inst_Type FROM Top10_Performances T2 GRO+
UP BY T2.Inst_Type HAVING COUNT(*) < 10))
DISCONNECT

CONN ADBTEST
EDIT * FROM Top10_Performances
RETURN

Try making all the rows the same, then making 10 the same and the other
different & leave the edit and return and try to make an 11th row the same.


Thanks & regards,
Alastair.


----- Original Message -----
From: "ELOEN" <[EMAIL PROTECTED]>
To: "RBASE-L Mailing List" <[EMAIL PROTECTED]>
Sent: Tuesday, January 28, 2003 10:07 AM
Subject: [RBASE-L] - Re: Rule problem


> Hi Albert,
>
> try this:
>
> RULES 'Limit of [ 10 ] entries reached!' FOR Top10_Performances SUCCEEDS
> WHERE+
>     Inst_Type NOT IN (SELE Inst_Type FROM Top10_Performances T1 WHERE+
>     T1.Inst_Type = Top10_Performances.Inst_Type) OR Inst_Type IN (SELE
> T2.Inst_Type+
>     FROM Top10_Performances T2 GROUP BY T2.Inst_Type HAVI COUNT(*) < 10)
>
> Polychronis T. Kontos
> Athens, Greece

Reply via email to