I want to list all the products name of which begins with ":pdName".
parameterRow.setString("pdName",jTextField_pdName.getText());
queryDataSet_srchAll.setQuery(ne
com.borland.dx.sql.dataset.QueryDescriptor(database_hsmng, "select
from onSale where productName like :pdName" + "%"+";", parameterRow,
true));
Unfortunately, above code takes no effect and my heart sinks to th
benthal.
Anyone knows how can it be done?
Thanks in advance
-
Marcol
-----------------------------------------------------------------------
Murray - 23 Jul 2004 15:10 GMT
> I want to list all the products name of which begins with ":pdName".
>
[quoted text clipped - 9 lines]
> Anyone knows how can it be done?
> Thanks in advance.
Well I'm not familiar with the classes you're using here, but I'm guessing
it's something like a PreparedStatement except it's using named parameters
instead of indexed params?
Think what this will look like: "where productName like :pdName" + "%"+";"
Those + symbols are useless, it's just String concatenation so it will
simply come out as "where productName like :pdName%;". It doesn't work
because no parameter called "pdfName%" exists. You need to append the '%'
symbol to the value, not the parameter name.
parameterRow.setString("pdName",jTextField_pdName.getText() + "%");
lukes - 23 Jul 2004 15:58 GMT
Marcolm <Marcolm.19unpn@mail.codecomments.com> wrote at Pt, 23 lip
2004 12:43:10 GMT:
> I want to list all the products name of which begins with ":pdName".
>
[quoted text clipped - 4 lines]
> from onSale where productName like :pdName" + "%"+";", parameterRow,
> true));
queryDataSet_srchAll.setQuery(new
com.borland.dx.sql.dataset.QueryDescriptor(database_hsmng, "select *
from onSale where productName like ':pdName%';", parameterRow,
true));
shouldnt text be in quotation-marks ( 'exampl%' ) ?

Signature
pozdrowka
lukes