Subject | Re: Generators don't works anymore |
---|---|
Author | amoradell |
Post date | 2007-12-17T20:39:39Z |
Hi,
1 - select (gen_comuni_id,0) from rdb$database : value
2 - insert record in columni without value for mycode
3 - select (gen_comuni_id,0) from rdb$database : value
should have changed !
but are you sure mycode is null ?
if not, gen_comuni_id is not called
you could try also with another generator.
regards
Alexandre
1 - select (gen_comuni_id,0) from rdb$database : value
2 - insert record in columni without value for mycode
3 - select (gen_comuni_id,0) from rdb$database : value
should have changed !
but are you sure mycode is null ?
if not, gen_comuni_id is not called
you could try also with another generator.
regards
Alexandre
--- In firebird-support@yahoogroups.com, Arn <odth@...> wrote:
>
> Sean:
> this is the code:
>
> // -------------------------------------------------------
>
> CREATE OR ALTER trigger comuni_bi for comuni
> active before insert position 0
> as
> begin
> if (new.mycode is null) then
> new.mycode = gen_id(gen_comuni_id,1);
> end
>
> // ----------------------------------------------------------
>
> Martijn:
> if I do:
>
> select gen_id( gen_comuni_id,1 ) from rdb$database
>
> Give Me GEN_ID=1
>