Subject Re: [IBO] parambyname
Author Lucas Franzen
Helmut Steinberger schrieb:
>
> Hello,
>
> I have a question to parambyname.
>
> I have a statement like:
>
> select * from table1
> where field1 = :param1 and
> field2 = :param2
>
> or another statement
>
> select * from storedproc1 (:param1, :param2, :param3)
>
> I use the Query as source for a ib_grid.
> In a event I have to change the parameters, to get other results form
> the query.
>
> ....
> ib_query1.parambyname (':param1').asinteger := 1;
> ib_query1.parambyname (':param2').asinteger := 2;
> ib_query1.parambyname (':param3').asinteger := 3;

this should read :

ib_query1.parambyname ('param1').asinteger := 1;

(without the colon in front of the name. The colon is used to mark it as
a param!)


> ........
>
> The problem ist, that it seems, that there is a fetch after every
> single assignement of a parameter.
> How could I solve this, that I can assign all parameters without a
> refresh of the dataset after every single parameterassignement?

You can use the code that Lester showed or you may have a look at at
Params.BeginUpdate and Params.EndUpdate.

Luc.