Mr Rao :SetFilter no funciona

Mr Rao :SetFilter no funciona

Postby Willi Quintana » Thu Mar 21, 2024 11:30 pm

Mr Rao.
esto no funciona:
oData:SetFilter("codbar1 LIKE '%RF-10392%'") // NO Funciona
oData:SetFilter("codbar1 LIKE '%RF10392%'") // Si Funciona

Gracias por su atencion
User avatar
Willi Quintana
 
Posts: 1019
Joined: Sun Oct 09, 2005 10:41 pm
Location: Cusco - Perú

Re: Mr Rao :SetFilter no funciona

Postby sysctrl2 » Fri Mar 22, 2024 7:43 pm

La tabla debe de tener un indice ordenado por el campo FIRST

Code: Select all  Expand view

  //setfilter
 cFirst := "Santos"
oRs:SetFilter( "FIRST = ?", { rtrim(cFirst) } )

//locate
  bSeek    := oRs:ExprAsBlock( "first = ?", { TRIM( cFirst ) } )
  if oRs:Locate( bSeek )
    ? "locate",oRs:STATE
  endif
 //seek
  if oRs:seek( cFirst,.t. )
    // ? oRs:id, oRs:FieldGet( "first" ), oRs:FieldGet("last"), oRs:age,oRs:state
  else
    ? "no existe"
  endif

 


Saludos !
Cesar SysCtrl Software :)
Cesar Cortes Cruz
SysCtrl Software
Mexico

' Sin +- FWH es mejor "
User avatar
sysctrl2
 
Posts: 1020
Joined: Mon Feb 05, 2007 7:15 pm

Re: Mr Rao :SetFilter no funciona

Postby Willi Quintana » Fri Mar 22, 2024 10:30 pm

Estimado sysctrl2

cVar := "RS-00887" //------------ el dato contioene un guion
oData:SetFilter("codbar1 LIKE '%" + cVar + "%'") //-----------------------> NO funciona, no filtra

cVar := "RS000887" //------------ el dato contioene un guion
oData:SetFilter("codbar1 LIKE '%" + cVar + "%'") //-----------------------> SI funciona, la variable no contiene guion

el campo codbar1 tiene indice
el problema es que por alguna razon el filtro no evalua cuando el patron de filtro tiene un guion
User avatar
Willi Quintana
 
Posts: 1019
Joined: Sun Oct 09, 2005 10:41 pm
Location: Cusco - Perú

Re: Mr Rao :SetFilter no funciona

Postby nageswaragunupudi » Sat Mar 23, 2024 8:21 am

La tabla debe de tener un indice ordenado por el campo FIRST

It is not at all necessary to have index for filters to work.
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10641
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: Mr Rao :SetFilter no funciona

Postby nageswaragunupudi » Sat Mar 23, 2024 8:28 am

Willi Quintana wrote:Mr Rao.
esto no funciona:
oData:SetFilter("codbar1 LIKE '%RF-10392%'") // NO Funciona
oData:SetFilter("codbar1 LIKE '%RF10392%'") // Si Funciona

Gracias por su atencion


This is a bug in our library. We regret for this. Also thank you for bringing this to our notice.
Works well if the Like Expression contains only numbers and alphabets but not chars like -, +, etc.

We are fixing this bug and testing now.

If the expression does not contain wild-card characters, you may use like this
Code: Select all  Expand view
oData:SetFilter("'RF-10392' $ UPPER(codbar1)")


Can you please let us know the FWH version you are using, Harbour or xHarbour and bcc or msvc.
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10641
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: Mr Rao :SetFilter no funciona

Postby Willi Quintana » Sat Mar 23, 2024 12:15 pm

Mr Eao, gracias por atenderme...

FW 23.07,
BCC 7.10
Harbour 3.2.0dev (r1904111533)

Saludos
User avatar
Willi Quintana
 
Posts: 1019
Joined: Sun Oct 09, 2005 10:41 pm
Location: Cusco - Perú

Re: Mr Rao :SetFilter no funciona

Postby sysctrl2 » Sat Mar 23, 2024 4:07 pm

MR. Rao, con tablas de miles de registros con índices es mas rápido
saludos.
Cesar Cortes Cruz
SysCtrl Software
Mexico

' Sin +- FWH es mejor "
User avatar
sysctrl2
 
Posts: 1020
Joined: Mon Feb 05, 2007 7:15 pm

Re: Mr Rao :SetFilter no funciona

Postby nageswaragunupudi » Sat Mar 23, 2024 7:54 pm

sysctrl2 wrote:MR. Rao, con tablas de miles de registros con índices es mas rápido
saludos.

Here we are not talking about DBF tables. What you said is true for DBF fiters.

We are talking about filters in mysql tables using fwh maria library. The data is in memory and filter is applied on data which is already in the memory. Filters, sorting, seeking are all done in memory and do not read from the server.
So there is no dependance at all on the indexes on the server.
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10641
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: Mr Rao :SetFilter no funciona

Postby nageswaragunupudi » Sat Mar 23, 2024 8:25 pm

We fixed the bug and this will work from the next release.

You said you are using FWH2307 with Harbour and BCC.
Please contact me on this email
nageswaragunupudi [at] gmail [dot] com.

I will send you the revised FiveH.lib for FWH2307 with this fix.
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10641
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: Mr Rao :SetFilter no funciona

Postby Willi Quintana » Sat Mar 23, 2024 10:07 pm

Muy agradecido Mr Rao
funciona perfectamente
Last edited by Willi Quintana on Sat Mar 23, 2024 10:52 pm, edited 1 time in total.
User avatar
Willi Quintana
 
Posts: 1019
Joined: Sun Oct 09, 2005 10:41 pm
Location: Cusco - Perú

Re: Mr Rao :SetFilter no funciona

Postby nageswaragunupudi » Sat Mar 23, 2024 10:27 pm

Just sent revised FiveH.lib (for FWH2307) for Harbour and BCC
Sent through "wetransfer.com"
You must have received a mail from them with link to download.
Please keep a safecopy of your present lib and use this new lib
Please let me know if the filters are working as expected.
Please acknowledge
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10641
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: Mr Rao :SetFilter no funciona

Postby nageswaragunupudi » Sat Mar 23, 2024 10:52 pm

This is my test:
Code: Select all  Expand view
#include "fivewin.ch"

function Main()

   local oCn
   local oRs, cFilter

   oCn := maria_Connect( "209.250.245.152,fwh,fwhuser,FiveTech@2022" )
   oRs   := oCn:RowSet( "select * from states" )

   cFilter  := "NAME Like '%nta-cat%'"  // case not sensitive
   oRs:SetFilter( cFilter )
   ? oRs:Filter
   oRs:GoTop()

   xbrowser oRs title FWVERSION

   oRs:Close()
   oCn:Close()

return nil


Result
Image
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10641
Joined: Sun Nov 19, 2006 5:22 am
Location: India


Return to FiveWin para Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 38 guests