Subject | Re: [firebird-support] Re: Query a table within its trigger |
---|---|
Author | Milan Babuskov |
Post date | 2012-07-06T11:10:22Z |
hanszorn2000 wrote:
that case variable LOCATION has uninitialized value, i.e. it could
contain anything (perhaps a value from some previous run). Try adding...
LOCATION = NULL;
...before the SELECT query.
HTH
--
Milan Babuskov
==================================
The easiest way to import XML, CSV
and textual files into Firebird:
http://www.guacosoft.com/xmlwizard
==================================
> declare LOCATION integer;You have a potential bug here. What if select does not return a row? In
> 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
> into :LOCATION, :ARTICLEID;
>
> NEW.NEWLOCATION = LOCATION;
that case variable LOCATION has uninitialized value, i.e. it could
contain anything (perhaps a value from some previous run). Try adding...
LOCATION = NULL;
...before the SELECT query.
HTH
--
Milan Babuskov
==================================
The easiest way to import XML, CSV
and textual files into Firebird:
http://www.guacosoft.com/xmlwizard
==================================