Subject | Re: [IBO] Prepare - Params question |
---|---|
Author | Geoff Worboys |
Post date | 2003-07-17T04:58:41Z |
> I'm asking because I'm aware using FieldByName has moreAll the same issues that apply to FieldByName also apply to
> overhead than the Fields array.
> Is it similar with ParamByName?
ParamByName, except that...
For most IBO uses your statements carry very few parameters.
(IBO usually handles inserts and edits, where there may be
many parameters, for you automatically.) So, since there are
normally so few parameters in the array search by name is
normally pretty fast.
Generally parameter assignments happen rarely, outside loops.
Whereas field processing often happens inside loops and so
the impact of a "by name" search has greater impact.
So if you situation does not fit these "normal" exceptions
that make ParamByName acceptable you need to think about it.
For example:
If you are running your own manual inserts, writing sql that
carries many parameters specifying values for insertion, then
you may be better served using the same style of coding as
you would with fields (get the column ref outside the loop
using byname, and then use the column ref inside the loop).
If you are executing a procedure with varing parameter values
inside a tightly loop then you may want to try using column
references rather than byname references (although if there
are only one or two parameters it probably wont make a huge
difference).
hth
--
Geoff Worboys
Telesis Computing