Board index » delphi » IBX/BDE Locate difference

IBX/BDE Locate difference

Hi there,

In my table there is one record where the column 'FIELDNAME' has the value
'EPC'.
Should this Locate statment find that record?

qry.Locate('FIELDNAME', 'E ', [loCaseInsensitive, loPartialKey]); // Notice
the space after the E

A BDE query doesnt find the query but a IBX query does find it.
I dont expect it to find it.

Is this a bug in IBX or simply a (known?) difference between the two?

Delphi5 (SP1)
IBX 4.6
InterBase 5.6
BDE 5.01

Thanks,
--
Andr di Geronimo
GEL Data AB

 

Re:IBX/BDE Locate difference


Hi Andr,

as I found in IbCustomDataSet.pas in in function
TIBCustomDataSet.InternalLocate(....): Boolean;
all values are right-trimmed :
.
.
          val[i] := TrimRight(val[i]);
.
.
As found in dbtables.pas the function TBDEDataSet.LocateRecord(.....):
Boolean;
doesn't change the values.

Hope that helps

Michael Adamovic

"Andr di Geronimo" <a...@home.se> schrieb im Newsbeitrag
news:3b4c1c8c_2@dnews...

Quote
> Hi there,

> In my table there is one record where the column 'FIELDNAME' has the value
> 'EPC'.
> Should this Locate statment find that record?

> qry.Locate('FIELDNAME', 'E ', [loCaseInsensitive, loPartialKey]); //
Notice
> the space after the E

> A BDE query doesnt find the query but a IBX query does find it.
> I dont expect it to find it.

> Is this a bug in IBX or simply a (known?) difference between the two?

> Delphi5 (SP1)
> IBX 4.6
> InterBase 5.6
> BDE 5.01

> Thanks,
> --
> Andr di Geronimo
> GEL Data AB

Re:IBX/BDE Locate difference


IBX treats string comparisons like VarChars and does trim off trailing spaces
before doing the comparison.

Quote
"Andr di Geronimo" wrote:

> Hi there,

> In my table there is one record where the column 'FIELDNAME' has the value
> 'EPC'.
> Should this Locate statment find that record?

> qry.Locate('FIELDNAME', 'E ', [loCaseInsensitive, loPartialKey]); // Notice
> the space after the E

> A BDE query doesnt find the query but a IBX query does find it.
> I dont expect it to find it.

> Is this a bug in IBX or simply a (known?) difference between the two?

> Delphi5 (SP1)
> IBX 4.6
> InterBase 5.6
> BDE 5.01

> Thanks,
> --
> Andr di Geronimo
> GEL Data AB

--
Jeff Overcash (TeamB)   I don't think there are any Russians
(Please do not email    And there ain't no Yanks
 me directly unless     Just corporate criminals
 asked.  Thank You)     Playing with tanks.  (Michael Been)

Re:IBX/BDE Locate difference


Quote
> IBX treats string comparisons like VarChars and does trim off trailing
spaces
> before doing the comparison.

Please consider that a bug. Trailing spaces are significant even when using
VARCHAR columns.
Otherwise you will be different from IBO as well as the BDE.

Variable length doesn't imply trimmed.

Jason Wharton
CPS - Mesa AZ
http://www.ibobjects.com

Other Threads