Subject | Re: [firebird-support] How to avoid that a table have more than 1 row? |
---|---|
Author | W O |
Post date | 2011-08-15T16:37:17Z |
Excellent idea, Svein!!!
Thank you very much.
Walter.
2011/8/15 Svein Erling Tysv�r <svein.erling.tysvaer@...>
Thank you very much.
Walter.
2011/8/15 Svein Erling Tysv�r <svein.erling.tysvaer@...>
> **[Non-text portions of this message have been removed]
>
>
> >Hello everybody
> >
> >I have a control table, which could to have one row and just one row,
> never
> >more.
> >
> >Which trigger I could to write for avoid inserts in that table if there is
> >one row on them?
> >
> >Thanks in advance.
>
> Very simple Walter. Add a PK field and then have a before insert trigger
> that looks something like:
>
> CREATE TRIGGER WalterTrigger FOR ControlTable ACTIVE BEFORE INSERT OR
> UPDATE POSITION 0 AS
> begin
> new.PK = 1;
> end
>
> HTH,
> Set
>
>
>