Subject RE: [IBO] Problem with Trigger on Table during insert.
Author Jason Wharton
If your fields are defined rather than auto generated you will need to
adjust it there.

Do CHECK_KEY=NOTREQUIRED and see if that works.

Jason

> -----Original Message-----
> From: IBObjects@yahoogroups.com [mailto:IBObjects@yahoogroups.com]On
> Behalf Of Jack Engleman
> Sent: Wednesday, November 29, 2006 5:36 PM
> To: IBObjects@yahoogroups.com
> Subject: Re: [IBO] Problem with Trigger on Table during insert.
>
>
> I put CHECK_KEY=COMPUTED in the columnattributes in the TIBOQuery
> and that did not stop the message. The query I use does not
> specify the
> columns. it is
> a SELECT * FROM CHECKS Should I specify all the column names.
>
> Thanks for the quick response.
>
> Jack
>
>
> Jason Wharton wrote:
> >
> > You can place a setting in the ColumnAttributes to flag the
> column as
> > NOTREQUIRED or also as COMPUTED, depending on your
> circumstances. In
> > either
> > case you are overriding the NOT NULL status of the column.
> IBO is not
> > aware
> > of what your trigger does.
> >
> > I also recommend that you update your trigger with a check
> for NULL. I
> > presume you only want it to provide a value if the NEW
> value is NULL.
> >
> > Jason
> >
> > > -----Original Message-----
> > > From: IBObjects@yahoogroups.com
> <mailto:IBObjects%40yahoogroups.com>
> > [mailto:IBObjects@yahoogroups.com
> <mailto:IBObjects%40yahoogroups.com>]On
> > > Behalf Of jack_engleman
> > > Sent: Wednesday, November 29, 2006 3:47 PM
> > > To: IBObjects@yahoogroups.com <mailto:IBObjects%40yahoogroups.com>
> > > Subject: [IBO] Problem with Trigger on Table during insert.
> > >
> > >
> > > This code has worked in using the BDE for the last 5
> years, but in the
> > > converted I am having a problem with a table checks and using a
> > > TIBOQuery to add a row to this table and the software
> complains the
> > > 'CHECK_KEY must have a value'.
> > >
> > > this trigger is created on the CHECKS table.
> > >
> > > CREATE TRIGGER SET_CHECK_NUM FOR CHECKS
> > > BEFORE INSERT AS
> > > BEGIN
> > > NEW.CHECK_KEY = GEN_ID(CHECK_KEY_GEN, 1);
> > > END^
> > >
> > > In the code below when I try to post I get the Error.
> > >
> > > Query_Checks.Close;
> > > Query_Checks.Open;
> > > Query_Checks.Insert;
> > > Query_Checks.FieldByName('ACC_KEY').AsInteger := WWAccKey;
> > > Query_Checks.FieldByName('EMP_KEY').AsInteger := EEmp_Key;
> > > Query_Checks.FieldByName('CHECK_DATE').AsDateTime :=
> > > DTP_CheckDate.Date;
> > > Query_Checks.FieldByName('PAY_DATE').AsDateTime := Date;
> > > Query_Checks.FieldByName('CHECK_NUM').AsString := Edit_check.Text;
> > > Query_Checks.FieldByName('AMT').AsCurrency := Amt;
> > > Query_Checks.Post;
> > > Query_Checks.Close;
> > >
> > > Can somebody give some pointers how to get around this problem??
> > >
> > > I am using the 4.6 Bc IBO version.
> > >
> > > Thanks in Advance
> > >
> > > Jack