Subject | Re: [firebird-support] Re: Recursive Triggers |
---|---|
Author | Ann W. Harrison |
Post date | 2005-03-18T16:57:13Z |
sdbeames wrote:
the database. Because it's a metadata operation, it doesn't take effect
until it's been committed, which you can't do in a trigger. Try this
instead, using a table called recursion_check to hold the state:
as begin
if not exists (select 1 from recursion_check
where user = CURRENT_USER
and recursion = 'true')
then begin
insert into recursion_check (user, recursion)
values (CURRENT_USER, 'true');
<do whatever>
delete from recursion_check
where user = CURRENT_USER
and recursion = 'true')
end
end
Regards,
Ann
>Disabling a trigger is a metadata operation that affects all users of
> I was hoping to do <disable self> <update table> <enable self>
> all within the trigger.
>
the database. Because it's a metadata operation, it doesn't take effect
until it's been committed, which you can't do in a trigger. Try this
instead, using a table called recursion_check to hold the state:
as begin
if not exists (select 1 from recursion_check
where user = CURRENT_USER
and recursion = 'true')
then begin
insert into recursion_check (user, recursion)
values (CURRENT_USER, 'true');
<do whatever>
delete from recursion_check
where user = CURRENT_USER
and recursion = 'true')
end
end
Regards,
Ann