Subject Re: [firebird-support] Problem in INSERT query
Author Adriano
Hi Luc and HJ,


>It looks like your generator GEN_FATTURE_IDFATTURA gives you back a new
>value which is always assigned to an existing record.

Not exactly my case ... in effect i import an old access database in
which there are old value of Primary Key with some old value
Example
1
2
5
6
9
10

When i insert some new value the
IF (NEW.IDFATTURA IS NULL) THEN
NEW.IDFATTURA = GEN_ID(GEN_FATTURE_IDFATTURA, 1);
END

reach the 1 that just exists and give me the error.

How to solve that ?

Another question that is linked to the problem above:
when i delete a record the Primary Key will be deleted too so it's
natural in that case to broke the autoincremental value of Primary
key, isn't it ?

Thanks for your help
Adriano