Parameterised Queries not returning data

Discussion of open issues, suggestions and bugs regarding usage of dbExpress drivers for Oracle in Delphi and C++Builder
Post Reply
shaun

Parameterised Queries not returning data

Post by shaun » Mon 14 Nov 2005 15:56

Hi,

There is a bug/feature where with fixed char fields when using parameters, if the field is not padded to the field size, then the query does not return the expected result.

Is this a problem with :
a) Oracle in general
b) Delphi
c) The Core Lab driver

Is there some hidden setting that can help me or is there any advice?

I am writing an app for 3 databases Oracle/Informix/MS SQL so I am trying to go as generic as possible.

Thanks

shaun

Post by shaun » Tue 15 Nov 2005 07:34

Ok, sorry one thing I forgot to mention is that this only happens when using a 'like' statement.

e.g.

product = 'a' //result correct

product like 'a%' //result correct

product like 'a' //result incorrect as nothing returned

Now this works fine on other databases just not Oracle. I am using a like to allow the users to do their own wild card searching and sometimes they won't put wild cards in which causes the issue. Obviously I can pad it but when working with a lot of different fields in many areas of the application this could become as issue if field sizes change at a later stage.

Paul
Posts: 725
Joined: Thu 28 Oct 2004 14:06

Post by Paul » Wed 16 Nov 2005 09:58

We reproduced your problem. This problem is concerned to the way that DbxOda uses for working with CHAR parameters and Oracle's specialities. We cannot correct this problem for CHAR parameters in DbxOda driver. Please use '%' in query condition.

Post Reply