Subject | Re: Firebird Triggers not working |
---|---|
Author | Svein Erling |
Post date | 2003-07-26T22:15:37Z |
John, I think your triggers are working, but that your error message
is generated before they get a chance to fire. Remember that triggers
are executed on the server, whereas IBObjects is a tool for the
client. IBO knows that the field has to be filled in, and refuse to
send anything to the server before you do so. The solution is pretty
simple. Either you
a) set the field to NOT REQUIRED explicitly, or
b) use GeneratorLinks.
In general, the latter of these approaches are encouraged. The reason
being that if you create the PK in an insert trigger on the server,
then there is just no way that IBO can know how to get back to the
record (it uses the primary key as its identifier, and noone has told
IBO which value it is - it like telling someone to call you without
supplying him with the phone number), and your newly inserted data
appear as lost until for your transaction.
HTH,
Set
is generated before they get a chance to fire. Remember that triggers
are executed on the server, whereas IBObjects is a tool for the
client. IBO knows that the field has to be filled in, and refuse to
send anything to the server before you do so. The solution is pretty
simple. Either you
a) set the field to NOT REQUIRED explicitly, or
b) use GeneratorLinks.
In general, the latter of these approaches are encouraged. The reason
being that if you create the PK in an insert trigger on the server,
then there is just no way that IBO can know how to get back to the
record (it uses the primary key as its identifier, and noone has told
IBO which value it is - it like telling someone to call you without
supplying him with the phone number), and your newly inserted data
appear as lost until for your transaction.
HTH,
Set
> I have viewed the triggers and generators via isql.exe and Database
> workbench, which say they are active. I have tried with and
> without the if clause in the trigger. However upon entering data
> via a grid or using a procedure with Append to the ibqWine query on
> post, I get the error "WINEID is a required field."
>
> So am I missing something here? It seems the generator/trigger
> doesn't work.
>
> Any tips/comments greatly appreciated,
>
> John