Subject | Re: [firebird-support] Re: update a field in after insert update |
---|---|
Author | Milan Babuskov |
Post date | 2009-03-15T18:18:17Z |
rogervellacott wrote:
update test_table s
set s.kyriga = 'test'
where s.<primary key> = new.<primary key>
and s.kyriga is distinct from 'test';
--
Milan Babuskov
http://www.flamerobin.org
http://www.guacosoft.com
> I suspect this would create an endless loop.If the field 'kyriga' is nullable, make sure you use:
>
> Better would be
> update test_table s
> set s.kyriga = 'test'
> where s.<primary key> = new.<primary key>
> and s.kyriga <> 'test'
update test_table s
set s.kyriga = 'test'
where s.<primary key> = new.<primary key>
and s.kyriga is distinct from 'test';
--
Milan Babuskov
http://www.flamerobin.org
http://www.guacosoft.com