Subject | RE: [IBO]Parameter values in DeleteSQL |
---|---|
Author | Calin Pirtea |
Post date | 2006-06-16T01:24:43Z |
Hi Paul,
This is how it works.
IBO will parse your statement and all parameters found are loaded in a
structure within IBO.
This structure is then parsed again looking for duplicate parameter
names. All duplicates are combined in order to allow you to use the same
parameter in different places (which works perfectly fine by the way).
The most important thing is for parameters to have the same type.
When assigning parameter values to the API IBO will lookup their index
and find them in it's own parameter list.
Now somewhere between combining duplicate parameters and assigning their
values it has lost the second index for the API so when that index is
found in the API it cannot assign a value to it.
This is a minor bug in IBO in my opinion but it is easy to avoid by
turning off the combineduplicate feature.
This feature is automatically turned off for insert/edit/delete
statements that drive ib_query.
This the place in the code where you have to change from
FCombineDuplicateParams := true; to FCombineDuplicateParams := false;
****
procedure TIB_UpdateSQL.PrepareCustomDML( ADSQL: TIB_Statement;
const ASQL: string );
var
ii: smallint;
tmpParam: TIB_Column;
tmpCol: TIB_Column;
tmpName: string;
ucName: string;
begin
with ADSQL do
begin
FCombineDuplicateParams := false;
***
I hope this helps answer your question.
Cheers,
Calin.
> -----Original Message-----You are almost right in your guess.
> From: IBObjects@yahoogroups.com
> On Behalf Of Paul Hope
> My point is that it shouldn't be different.
> I'm guessing now . .
> When it processes a param assignment I assume it gives up
> after the first occurrence of the param name ignoring any duplicates?
> If this assumption is correct I would have thought it would
> be a great improvement to get it to process any additional
> parameters with the same name.
>
This is how it works.
IBO will parse your statement and all parameters found are loaded in a
structure within IBO.
This structure is then parsed again looking for duplicate parameter
names. All duplicates are combined in order to allow you to use the same
parameter in different places (which works perfectly fine by the way).
The most important thing is for parameters to have the same type.
When assigning parameter values to the API IBO will lookup their index
and find them in it's own parameter list.
Now somewhere between combining duplicate parameters and assigning their
values it has lost the second index for the API so when that index is
found in the API it cannot assign a value to it.
This is a minor bug in IBO in my opinion but it is easy to avoid by
turning off the combineduplicate feature.
This feature is automatically turned off for insert/edit/delete
statements that drive ib_query.
This the place in the code where you have to change from
FCombineDuplicateParams := true; to FCombineDuplicateParams := false;
****
procedure TIB_UpdateSQL.PrepareCustomDML( ADSQL: TIB_Statement;
const ASQL: string );
var
ii: smallint;
tmpParam: TIB_Column;
tmpCol: TIB_Column;
tmpName: string;
ucName: string;
begin
with ADSQL do
begin
FCombineDuplicateParams := false;
***
I hope this helps answer your question.
Cheers,
Calin.