Page 1 of 1

Parameterised Queries not returning data

Posted: Mon 14 Nov 2005 15:56
by shaun
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

Posted: Tue 15 Nov 2005 07:34
by shaun
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.

Posted: Wed 16 Nov 2005 09:58
by Paul
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.