Subject | Re: [firebird-support] Problem in INSERT query |
---|---|
Author | HJ |
Post date | 2006-05-19T09:02:13Z |
Adriano wrote:
add more check to your before insert trigger:
IF ((NEW.IDFATTURA IS NULL) OR (NEW.IDFATTURA = 0)) THEN
NEW.IDFATTURA = GEN_ID(GEN_FATTURE_IDFATTURA, 1);
END
HTH,
HJ
> Hi,May be IDFATTURA field is set to zero at your client application. Try
> Firebird 2 RC1 Windows, Driver ODBC, Visual Basic
> I've a table FATTURE with some fields,
> a field named IDFATTURA which is Primary Key (not null, unique and active)
> a autoincremental trigger in Before Insert
> BEGIN
> IF (NEW.IDFATTURA IS NULL) THEN
> NEW.IDFATTURA = GEN_ID(GEN_FATTURE_IDFATTURA, 1);
> END
>
add more check to your before insert trigger:
IF ((NEW.IDFATTURA IS NULL) OR (NEW.IDFATTURA = 0)) THEN
NEW.IDFATTURA = GEN_ID(GEN_FATTURE_IDFATTURA, 1);
END
HTH,
HJ