Re: [firebird-support] Strange SELECT FIRST 1

2012-09-12 Thread Mr. John
Thanks Ann for your explanations ! From: Ann Harrison To: firebird-support@yahoogroups.com Sent: Thursday, September 13, 2012 12:21 AM Subject: Re: [firebird-support] Strange SELECT FIRST 1   On Wed, Sep 12, 2012 at 3:25 PM, Mr. John wrote: > Hi

Re: [firebird-support] Strange SELECT FIRST 1

2012-09-12 Thread Ann Harrison
On Wed, Sep 12, 2012 at 3:25 PM, Mr. John wrote: > Hi Ann,thanks for your tips,so SELECT FIRST 1 is slower than > simple SELECT ? > Not in general, but why complicate things? > Why to add ORDER BY ? > That gives you a chance of getting the same record every time.Lets assume you have a

Re: [firebird-support] Strange SELECT FIRST 1

2012-09-12 Thread Mr. John
Hi Ann,thanks for your tips,so   SELECT FIRST 1   is slower than simple SELECT ? Why to add ORDER BY ? Thanks ! From: Ann Harrison To: firebird-support@yahoogroups.com Sent: Wednesday, September 12, 2012 9:09 PM Subject: Re: [firebird-support] Strange SELECT

Re: [firebird-support] Strange SELECT FIRST 1

2012-09-12 Thread Ann Harrison
On Wed, Sep 12, 2012 at 6:18 AM, Mr. John wrote: > Hi,I'm using FB 2.5.1.26351 SS on XP SP3,I have one stored > procedure,also inside > FOR EXECUTE STATEMENT loop I have this query > > SELECT FIRST 1 id_cf,numar FROM CB_FC WHERE ID_CF=:wid_cf > AND numar=:wNUMAR INTO :xid_cf,:xnumar; > That

Re: [firebird-support] Strange SELECT FIRST 1

2012-09-12 Thread Mr. John
Thanks all for your help,I'll review my code to fix that From: Lucas Franzen To: firebird-support@yahoogroups.com Sent: Wednesday, September 12, 2012 2:21 PM Subject: Re: [firebird-support] Strange SELECT FIRST 1   Am 12.09.2012 13:13, schrieb Mr.

Re: [firebird-support] Strange SELECT FIRST 1

2012-09-12 Thread Lucas Franzen
Am 12.09.2012 13:13, schrieb Mr. John: > 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 ? > Yes. Null is an unknown value, whereas returning no record is not unknown, it's just nothing. S

Re: [firebird-support] Strange SELECT FIRST 1

2012-09-12 Thread Mr. John
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; >

Re: [firebird-support] Strange SELECT FIRST 1

2012-09-12 Thread 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 >

[firebird-support] Strange SELECT FIRST 1

2012-09-12 Thread Mr. John
Hi,I'm using FB 2.5.1.26351 SS  on  XP SP3,I have one stored procedure,also inside  FOR EXECUTE STATEMENT loop I have this query  SELECT FIRST 1 id_cf,numar FROM CB_FC WHERE  ID_CF=:wid_cf AND numar=:wNUMAR INTO :xid_cf,:xnumar;     wNUMAR,wid_cf  are also variables   declare xID_CF bigint;DEC