[firebird-support] Re: Query a table within its trigger

2012-07-06 Thread hanszorn2000
--- In firebird-support@yahoogroups.com, unordained unordained_00@... wrote: I suppose there's the possibility of index corruption. You could test that by making sure the optimizer can't use the index: and (ARTICLE.ISACTIVE || '' = 'F') or something similar. The only time I've seen an

[firebird-support] Re: Query a table within its trigger

2012-07-06 Thread hanszorn2000
--- In firebird-support@yahoogroups.com, Helen Borrie helebor@... wrote: If you have a row in a table that depends on values in other rows in the same table then you have a serious flaw in your relational design. Move that column or set into another table. That's an interesting point you

Re: [firebird-support] Re: Query a table within its trigger

2012-07-06 Thread Milan Babuskov
hanszorn2000 wrote: declare LOCATION integer; declare ARTICLEID varchar(20); BEGIN select first 1 NEWLOCATION, ARTICLEID from ARTICLE where ARTICLE.CUSTID = NEW.CUSTID and ARTICLE.ISACTIVE = 'F' and ARTICLE.NEWLOCATION is not null order by NEWLOCATION

Re: [firebird-support] Re: Query a table within its trigger

2012-07-06 Thread Helen Borrie
At 10:18 PM 6/07/2012, hanszorn2000 wrote: --- In firebird-support@yahoogroups.com, Helen Borrie helebor@... wrote: If you have a row in a table that depends on values in other rows in the same table then you have a serious flaw in your relational design. Move that column or set into

[firebird-support] Re: Query a table within its trigger

2012-07-05 Thread hanszorn2000
--- In firebird-support@yahoogroups.com, Thomas Steinmaurer ts@... wrote: I am wondering if there are any known issues with queries within a trigger, when that query accesses the table on which the trigger fires (before insert, so no race condition). I am experiencing unpredictable

[firebird-support] Re: Query a table within its trigger

2012-07-05 Thread hanszorn2000
--- In firebird-support@yahoogroups.com, unordained unordained_00@... wrote: declare LOCATION integer; declare ARTICLEID varchar(20); BEGIN select first 1 NEWLOCATION, ARTICLEID from ARTICLE where ARTICLE.CUSTID = NEW.CUSTID and ARTICLE.ISACTIVE = 'F'

Re: [firebird-support] Re: Query a table within its trigger

2012-07-05 Thread unordained
-- Original Message --- From: hanszorn2000 hansz...@xs4all.nl declare LOCATION integer; declare ARTICLEID varchar(20); BEGIN select first 1 NEWLOCATION, ARTICLEID from ARTICLE where ARTICLE.CUSTID = NEW.CUSTID and ARTICLE.ISACTIVE = 'F'