Subject Re: [IBO] Prepare Question
Author Jason Wharton
One thing to add to this is to make sure that you Close the TIB_Cursor once
the value is obtained. This should be in a finally block too. If you use
cursors you have to make sure you close them or you can hold the transaction
open and back up the OAT advancement.

HTH,
Jason Wharton
CPS - Mesa AZ
http://www.ibobjects.com

----- Original Message -----
From: "Andreas Pohl" <apohl@...>

> At the beginning I often use this pseudo code to call only one value from
a
> table:
> with IB_DSQL do begin
> sql.text:='select field from table where nr=:nr';
> prepare;
> while condition do begin
> Params.ByName('nr').AsInteger:=IntValue;
> execute;
> // doing sth, with result set
> end;
> end;
>
> This was working fine and quick. But in current release of IBO this code
is
> working only once. Second loop will cause an exception. Jason changed sth.
> behind the scene to avoid a known IB bug. After changing TIB_DSQL to
> TIB_Cursor above pseudo code is working well.
>
> Mit freundlichem Gruss & Best Regards
>
> Andreas Pohl
> apohl@...
> www.ibp-consult.com