Subject | Re: [firebird-support] Problem in INSERT query |
---|---|
Author | Adriano |
Post date | 2006-05-19T22:36:12Z |
Hi Luc and HJ,
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
>It looks like your generator GEN_FATTURE_IDFATTURA gives you back a newNot exactly my case ... in effect i import an old access database in
>value which is always assigned to an existing record.
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