Subject | Re: Before Insert Trigger |
---|---|
Author | Svein Erling Tysvær |
Post date | 2006-03-21T09:00:32Z |
Sorry Sergio, the answer to your question is simple, what you are
trying to do is impossible to do in a trigger. The trigger is executed
on the server when the record is inserted (that's when you post, not
before) and the result not returned to your client. What you seem to
want to do, has to be done at the client if you need to know the value
before you post (and I think you have to refresh if you want to know
the value after posting).
Sorry,
Set
trying to do is impossible to do in a trigger. The trigger is executed
on the server when the record is inserted (that's when you post, not
before) and the result not returned to your client. What you seem to
want to do, has to be done at the client if you need to know the value
before you post (and I think you have to refresh if you want to know
the value after posting).
Sorry,
Set
--- In IBObjects@yahoogroups.com, "Sergio" wrote:
> Hi All.
>
> I have declared a Before Insert Trigger, and in that trigger a need
> to assign a value to a field. That value depend of some conditions.
>
> In my Delphi project (WXP, D7, IBO v4.5, FB v1.5.3) I'm using a
> TIBOQuery component, and some Delphi's visual native components
> (TDBGrid, and so on). Everything is fine, but when I insert a new
> record (and before post it) I need to view a value that the server
> assigned to that field. Exist some way to do it?
>
> My trigger looks something like that:
>
> CREATE TRIGGER TriggerName FOR TableName ACTIVE
> BEFORE INSERT POSITION 1
> AS
> BEGIN
> :
> :
> IF (SomeCondition) THEN
> NEW.MyField = SomeValue
> ELSE
> NEW.MyField = AnotherValue;
> :
> :
> END
>
> Thanks, and sorry my English.
>
> With Regards
> Sergio