Subject Re: [ib-support] limit the number of records?
Author Daniel Bertin

nice, my intention was to give a demo to a user, where the code, would
limit him to entering x number of records. It would restrict him from
entering any more that the limit amount, and then be able to change that limit.

this would be workable

At 10:29 PM 26/03/2002 -0300, you wrote:
>If I get what you want you could do something like this:
>This is only a "road map", the code below *will not compile*, it's just to
>see if a get what you want, if it's what you want tell me and I will
>produce a "workable code".
>The code below will teste in a trigger (before insert) if the quantity of
>record inserted in the last hour is greater than some limit. Or do you
>prefer some kind of "human reset" so only the "administrator" could say
>"Ok. Joe go ahead now you can insert a more "X" records". You could create
>another table that holds periods (even slices of days) and the quantity of
>records that some user could insert, I don't know the intention for this
>check, but there are a lot of ways to get this work.
>Create Table Friend( Name varchar(50),
> Phone varchar(30),
> UserID integer,
> TimeStamp Date); -- NOTE Dialect 1 here
>in the before insert trigger you could put something like this:
> count(*)
> Friend
> UserID = New.UserID and
> (Now - TimeStamp) < (1/24) -- for a hour period
> :Qtd
>if Qtd > 10
> Raise Exception
>At 16:06 26/03/02 -0800, you wrote:
> >Hi all,
> >I'm a little puzzled,
> >I would like to limit the number of records a user can enter into a table,
> >and am looking for suggestions on how I should accomplish this.
> >A routine on the client or on the server? on the client counting the number
> >of records, how often or when should I count?
> >on the server with a stored procedure, executed at certain intervals or on
> >a trigger?
> >I would like to stop the user from entering anymore records into a table
> >after he has reached a certain limit(#of records).
> >I'm using D5,IBO,FB1,
> >Would someone have a suggestion on how I should accomplish this task?
> >Thanks in advance
> >Daniel
>Yahoo! Groups Sponsor
>To unsubscribe from this group, send an email to:
>Your use of Yahoo! Groups is subject to the
><>Yahoo! Terms of Service.

[Non-text portions of this message have been removed]