FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour FWH MariaDb/Mysql setfilter problem.
Posts: 883
Joined: Tue Oct 11, 2005 11:57 AM
FWH MariaDb/Mysql setfilter problem.
Posted: Mon Aug 27, 2018 10:08 PM

Nages...

oDbDato:SetFilter("nombre like '%NAME LASTNAME%'") does not work.
Only oDbDato:SetFilter("nombre like '%LASTNAME%'") works, each time a space is in the filter, it does not work.

Any tip or advice

From Chile Adolfo

;-) Ji,ji,ji... buena la cosa... "all you need is code"

http://www.xdata.cl - Desarrollo Inteligente
----------
Asus TUF F15, 32GB Ram, 2 * 1 TB NVME M.2, GTX 1650
Posts: 1598
Joined: Fri Oct 07, 2005 05:56 PM
Re: FWH MariaDb/Mysql setfilter problem.
Posted: Tue Aug 28, 2018 12:19 AM
Dear Adolfo,

If you use FWMARIADB, You can use :SetFilter() as xbase syntax.

Code (fw): Select all Collapse
oDbDato:SetFilter(" 'LASTNAME' $ nombre ")


or
exactly

Code (fw): Select all Collapse
oDbDato:SetFilter("nombre=?",{"ADO"} )
oDbDato:ReFilter( {"SMITH"} )


or more details
viewtopic.php?f=3&t=32657

I hope, may help.
Adolfo wrote:Nages...

oDbDato:SetFilter("nombre like '%NAME LASTNAME%'") does not work.
Only oDbDato:SetFilter("nombre like '%LASTNAME%'") works, each time a space is in the filter, it does not work.

Any tip or advice

From Chile Adolfo
Regards,

Dutch



FWH 2304 / xHarbour Simplex 1.2.3 / BCC73 / Pelles C / UEStudio

FWPPC 10.02 / Harbour for PPC (FTDN)

ADS V.9 / MySql / MariaDB

R&R 12 Infinity / Crystal Report XI R2

(Thailand)
Posts: 883
Joined: Tue Oct 11, 2005 11:57 AM
Re: FWH MariaDb/Mysql setfilter problem.
Posted: Tue Aug 28, 2018 12:03 PM

Hi dutch

It wont work... I dont know if the customer is going to enter only the name or both name and lastname.
And it could be any of the fields in a xbrowse, it is created dinamically

The only problem I see, is the space in between the variable you pass to the filter ???

;-) Ji,ji,ji... buena la cosa... "all you need is code"

http://www.xdata.cl - Desarrollo Inteligente
----------
Asus TUF F15, 32GB Ram, 2 * 1 TB NVME M.2, GTX 1650
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: FWH MariaDb/Mysql setfilter problem.
Posted: Tue Aug 28, 2018 02:47 PM
Please use simple DBF syntax like this:
Code (fw): Select all Collapse
oDbDato:SetFilter("'NAME LASTNAME' $ UPPER( nombre )")

Rowset filters work exactly like the DBF filters we use.
Regards



G. N. Rao.

Hyderabad, India
Posts: 883
Joined: Tue Oct 11, 2005 11:57 AM
Re: FWH MariaDb/Mysql setfilter problem.
Posted: Tue Aug 28, 2018 06:37 PM

Thanks... works as exspected

From Chile Adolfo

;-) Ji,ji,ji... buena la cosa... "all you need is code"

http://www.xdata.cl - Desarrollo Inteligente
----------
Asus TUF F15, 32GB Ram, 2 * 1 TB NVME M.2, GTX 1650
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: FWH MariaDb/Mysql setfilter problem.
Posted: Tue Aug 28, 2018 06:49 PM

As you said, if the constant has a space character, setting filter with like clause is not working. We did not notice it until you pointed out. It will also work from FWH 18.06 onwards.

Regards



G. N. Rao.

Hyderabad, India

Continue the discussion