Subject Re: [firebird-support] Strange SELECT FIRST 1
Author masotti
Hi,

On 12/09/2012 12:18, Mr. John wrote:
> What I don't understand,for this query
> ...............
> SELECT FIRST 1 id_cf,numar FROM CB_FC WHERE ID_CF=:wid_cf AND
> numar=:wNUMAR INTO :xid_cf,:xnumar;
> IF (wNUMAR=10739 and wid_cf=202) THEN
> begin
> INSERT INTO GN_DEBUG(MSG) VALUES(:wid_cf||'
> '||:xid_cf||' '||:wnumar||' ||:xNUMAR);
> end..........................


Perhaps you shoud set xid_cf and xnumar to NULL before SELECTing that
values, because if your select doesn't return a record (where condition
unsatisfied) those values remains unchanged, and in a loop you'll find
values of the previous fetched record.

HTH

MM