Subject | Re: [firebird-support] Strange SELECT FIRST 1 |
---|---|
Author | Mr. John |
Post date | 2012-09-12T11:13:51Z |
Hi masotti ,thanks for your answer,I always thought in this case when select doesn't return a record,these variables are set to NULL,that I was wrong ?
thanks
________________________________
From: masotti <masotti@...>
To: firebird-support@yahoogroups.com
Sent: Wednesday, September 12, 2012 2:03 PM
Subject: Re: [firebird-support] Strange SELECT FIRST 1
Hi,
thanks
________________________________
From: masotti <masotti@...>
To: firebird-support@yahoogroups.com
Sent: Wednesday, September 12, 2012 2:03 PM
Subject: Re: [firebird-support] Strange SELECT FIRST 1
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
[Non-text portions of this message have been removed]