Subject | Re: [IBO] faster coding method |
---|---|
Author | Jason Wharton |
Post date | 2003-07-31T06:03:12Z |
Definitely use input parameters.
Also rather than calling Refresh, check to see if you are getting new values
and if so close the dataset, set the new parameter values and then open it
again.
Jason Wharton
http://www.ibobjects.com
Also rather than calling Refresh, check to see if you are getting new values
and if so close the dataset, set the new parameter values and then open it
again.
Jason Wharton
http://www.ibobjects.com
----- Original Message -----
From: "james_027" <james_027@...>
To: <IBObjects@yahoogroups.com>
Sent: Wednesday, July 30, 2003 10:51 PM
Subject: [IBO] faster coding method
> I have this piece of code in one of my table1 after scroll event,
> since table2 could be refresh very often which of my code would be
> much faster. or if you have any suggestion which is better than mine.
>
>
> table2.close;
> table2.sql.clear;
> table2.sql.add('select * from simulateingredients('+table1.fieldbyname
> ('itemid').asstring+', '+table1.fieldbyname('qty').asstring+')');
> table2.open;
>
>
> or
>
>
> table2.parambyname('paramitemid').asinteger:=table1.fieldbyname
> ('itemid').asinteger;
> table2.parambyname('paramqty').asfloat:=table1.fieldbyname
> ('qty').asfloat;
> table2.refresh?
>
>
> which is more optimize?
>
>
> or your suggestions????
>
>
>
> btw the simulateingredients is a stored procedure .... i use ib_query
> for both table1 and table2.
>
>
> thanks