Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 7 of 7 total
Thread Prepare/Unprepare
Mon, Sep 22 2008 12:30 PMPermanent Link

UliBecker
I am using this code to prepare a query:

with dm.PRPatientenQuery do
 begin
   sql.add('select * from Patienten where PatientenID in');
   sql.add('(select PatientenID from Anforderungen where Ambulant = :Ambulant)');
   prepare;
 end;

 When executing the query like this:

 with dm.PRPatientenQuery do
 begin
   close;
   ParamByName('Ambulant').asBoolean := true;
   open;
   ShowMessage(inttostr(dm.PRPatientenQuery.recordcount));
   close;
   ParamByName('Ambulant').asBoolean := false;
   open;
   ShowMessage(inttostr(dm.PRPatientenQuery.recordcount));
 end;

 the result is the same with both parameters (true and false), though it shouldn't.
 
 close;
 unprepare;

 works. Have I really to unprepare the query each time? If so, what is the sense of preparing it?

Regards Uli
Tue, Sep 23 2008 8:07 AMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Uli,

<< the result is the same with both parameters (true and false), though it
shouldn't. >>

I'll have to check this out.  You should only need to prepare it once.

--
Tim Young
Elevate Software
www.elevatesoft.com

Wed, Sep 24 2008 11:04 AMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Uli,

<< the result is the same with both parameters (true and false), though it
shouldn't. >>

I can't reproduce this here.  I'm getting one row with one (True) and zero
rows with the other (False), which matches the test data that I've put in
place.

--
Tim Young
Elevate Software
www.elevatesoft.com

Wed, Sep 24 2008 12:53 PMPermanent Link

UliBecker
Tim,

<< I can't reproduce this here.  I'm getting one row with one (True) and zero
rows with the other (False), which matches the test data that I've put in
place.
>>

I'll try to send you the data I am using and the query to reproduce that.

Regards Uli
Fri, Sep 26 2008 6:03 AMPermanent Link

UliBecker
Sample sent by mail.

Uli.
Fri, Oct 3 2008 6:00 PMPermanent Link

Uli Becker
Tim,

any news concerning this thread?

Regards Uli
Mon, Oct 6 2008 12:06 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Uli,

<< any news concerning this thread? >>

Sorry, yes, you are correct.  There is an issue when using an IN sub-select
with a parameter combined with an insensitive result set.  The second
execution after changing the parameter will result in the same rows being
returned.

A fix will be in 2.02.

--
Tim Young
Elevate Software
www.elevatesoft.com

Image