Subject | RE: [IBO] Problem with SIMILAR TO in TIBO_QUERY.FILTER property |
---|---|
Author | IBO Support List |
Post date | 2012-01-02T17:30:40Z |
Laurent,
Ok, thank you. The problem is fixed. It will be in the next release.
Here also is a patch if you like:
Unit: IB_ParseEx.pas
Routine: ExtractFilterClause
Lines: 2360 to 2400 (somewhere in that range)
...
if ( iboUpperCase( AOper ) = 'STARTING' ) or
( iboUpperCase( AOper ) = 'STARTS' ) then
begin
if Trim( iboUpperCase( tmpStr )) = 'WITH' then
begin
AOper := AOper + ' ' + Trim( tmpStr );
tmpStr := PluckFirstToken( AFilter,
false,
false,
false, // Single
false, // Double
true, // Period
false ); // Dash
end;
ProcessExpr( tmpStr );
AItem := tmpStr;
end
else
// Add in below
if ( iboUpperCase( AOper ) = 'SIMILAR' ) then
begin
if Trim( iboUpperCase( tmpStr )) = 'TO' then
begin
AOper := AOper + ' ' + Trim( tmpStr );
tmpStr := PluckFirstToken( AFilter,
false,
false,
false, // Single
false, // Double
true, // Period
false ); // Dash
end;
ProcessExpr( tmpStr );
AItem := tmpStr;
end
else
// Add in above
if iboUpperCase( AOper ) = 'LIKE' then
begin
ProcessExpr( tmpStr );
AItem := tmpStr;
if iboPos( 'ESCAPE', AFilter ) = 1 then
begin
tmpStr := PluckFirstToken( AFilter,
false,
false,
false, // Single
false, // Double
true, // Period
false ); // Dash
AItem := AItem + ' ESCAPE ';
tmpStr := PluckFirstToken( AFilter,
false,
false,
false, // Single
false, // Double
true, // Period
false ); // Dash
AItem := AItem + tmpStr;
end;
end
else
...
Thanks,
Jason
-----Original Message-----
From: IBObjects@yahoogroups.com [mailto:IBObjects@yahoogroups.com] On Behalf
Of l_gilbert_fr
Sent: 02 January 2012 10:01 AM
To: IBObjects@yahoogroups.com
Subject: Re: [IBO] Problem with SIMILAR TO in TIBO_QUERY.FILTER property
Jason,
I put a little program in the files area.
I use the last version of IBO with DELPHI XE and FIREBIRD x64 2.5.1.
The sample connect to EMPLOYEE.FDB database and open the employee table.
When you click on the filtered checkbox, the program assigns a filter on the
table which used the SIMILAR keyword on the FIRST_NAME field.
The exception occurs when you activates the filter.
Regards,
Laurent.
--- In IBObjects@yahoogroups.com, "IBO Support List" <supportlist@...>
wrote:
Ok, thank you. The problem is fixed. It will be in the next release.
Here also is a patch if you like:
Unit: IB_ParseEx.pas
Routine: ExtractFilterClause
Lines: 2360 to 2400 (somewhere in that range)
...
if ( iboUpperCase( AOper ) = 'STARTING' ) or
( iboUpperCase( AOper ) = 'STARTS' ) then
begin
if Trim( iboUpperCase( tmpStr )) = 'WITH' then
begin
AOper := AOper + ' ' + Trim( tmpStr );
tmpStr := PluckFirstToken( AFilter,
false,
false,
false, // Single
false, // Double
true, // Period
false ); // Dash
end;
ProcessExpr( tmpStr );
AItem := tmpStr;
end
else
// Add in below
if ( iboUpperCase( AOper ) = 'SIMILAR' ) then
begin
if Trim( iboUpperCase( tmpStr )) = 'TO' then
begin
AOper := AOper + ' ' + Trim( tmpStr );
tmpStr := PluckFirstToken( AFilter,
false,
false,
false, // Single
false, // Double
true, // Period
false ); // Dash
end;
ProcessExpr( tmpStr );
AItem := tmpStr;
end
else
// Add in above
if iboUpperCase( AOper ) = 'LIKE' then
begin
ProcessExpr( tmpStr );
AItem := tmpStr;
if iboPos( 'ESCAPE', AFilter ) = 1 then
begin
tmpStr := PluckFirstToken( AFilter,
false,
false,
false, // Single
false, // Double
true, // Period
false ); // Dash
AItem := AItem + ' ESCAPE ';
tmpStr := PluckFirstToken( AFilter,
false,
false,
false, // Single
false, // Double
true, // Period
false ); // Dash
AItem := AItem + tmpStr;
end;
end
else
...
Thanks,
Jason
-----Original Message-----
From: IBObjects@yahoogroups.com [mailto:IBObjects@yahoogroups.com] On Behalf
Of l_gilbert_fr
Sent: 02 January 2012 10:01 AM
To: IBObjects@yahoogroups.com
Subject: Re: [IBO] Problem with SIMILAR TO in TIBO_QUERY.FILTER property
Jason,
I put a little program in the files area.
I use the last version of IBO with DELPHI XE and FIREBIRD x64 2.5.1.
The sample connect to EMPLOYEE.FDB database and open the employee table.
When you click on the filtered checkbox, the program assigns a filter on the
table which used the SIMILAR keyword on the FIRST_NAME field.
The exception occurs when you activates the filter.
Regards,
Laurent.
--- In IBObjects@yahoogroups.com, "IBO Support List" <supportlist@...>
wrote:
>Behalf
> Would you mind sending me a little sample app of this problem?
> This would save me a lot of time if you would be so kind.
> I'm about to release a new build and I would like to slip in the fix for
> this.
>
> Thanks,
> Jason
>
> -----Original Message-----
> From: IBObjects@yahoogroups.com [mailto:IBObjects@yahoogroups.com] On
> Of l_gilbert_frprefix
> Sent: 02 January 2012 09:20 AM
> To: IBObjects@yahoogroups.com
> Subject: Re: [IBO] Problem with SIMILAR TO in TIBO_QUERY.FILTER property
>
> Thank you Jason for you reply, I always forgot the existence of this
> !!!it
>
> Laurent.
>
> --- In IBObjects@yahoogroups.com, "IBO Support List" <supportlist@>
> wrote:
> >
> > This is likely a bug in the IBO filter processing logic.
> > For the time being you can preface the filter with a clause that causes
> > to directly pass through the filter unmodified.of
> >
> > ::SQL::
> >
> > Jason
> >
> > -----Original Message-----
> > From: IBObjects@yahoogroups.com [mailto:IBObjects@yahoogroups.com] On
> Behalf
> > Of l_gilbert_fr
> > Sent: 02 January 2012 05:07 AM
> > To: IBObjects@yahoogroups.com
> > Subject: [IBO] Problem with SIMILAR TO in TIBO_QUERY.FILTER property
> >
> > Hi all,
> >
> > I wonder if someone has the same problem I'm encountering.
> >
> > I update my application to use FIREBIRD 2.5 internal functions instead
> > UDF functions.function,
> >
> > In this way, I replaced regular expression search by the SIMILAR
> > but even if my query works very well when I run it from IBEXPERT, I gota
> > syntax error from IBO (4.9.14b32) about a bad parenthesis count.
> >
> > The filter looks like <<((XXX SIMILAR TO
> > '[A-Z]?[A-Z]?10[[:DIGIT:]]{3}[[:ALNUM:]]*'))>>
> >
> > I made many tests without success but if I replace "SIMILAR TO" by a
> simple
> > "=", I don't get a syntax error anymore. This last test is only to
> validate
> > the syntax even if it produces a bad result.
> >
> > The exception message is :
> > Syntaxe Invalide: parenthèse en trop ou en moins:
> > (
> > (
> > XXX SIMILAR TO
> > '[A-Z]?[A-Z]?10[[:DIGIT:]]{3}[[:ALNUM:]]*')
> > )
> >
> > I think IBO doesn't show the first ')'.
> >
> > Regards,
> >
> > Laurent.