Subject Triggers and field Values (1.5rc7)
Author Ian A. Newby
Hi Folks,

I have the following trigger:

CREATE TRIGGER CONTENT_BI_SET_ID FOR CONTENT
ACTIVE BEFORE INSERT OR UPDATE POSITION 0
as
begin
if ((new.pge_depth is null) or (coalesce(new.pge_parent_id,'') <>
coalesce(old.pge_parent_id,''))) Then
begin
new.pge_depth = 0;
new.pge_breadcrumb = new.pge_title;


select c.pge_breadcrumb || ' > ' || new.pge_title, coalesce
(c.pge_depth,0) + 1 from content c where c.pge_id =
new.pge_parent_id into new.pge_breadcrumb, new.pge_depth;


update content set pge_depth = null where pge_parent_id =
new.pge_id;
end
end

The question is, should the select line take the current version of
the record or the version set in the trigger when the "update
content" statement fires? It seems to be taking the pre-trigger
version. Should I move the update statement to an after trigger?

Regards
Ian Newby.