Ayuda con FILTER y MARIADB

Re: Ayuda con FILTER y MARIADB

Postby nageswaragunupudi » Wed Mar 16, 2022 5:30 am

Please note that FILTERS are totally different from WHERE clause.

WHERE clause is used to read limited set of records/rows from the table on the server.

FILTER is used to filter records/rows already read into the memory of the client PC (our PC)
Filter clause does not know the field names in the main table. Filters operate on the field name ALIAS used in the query.
Filters behave the same way like ADO.

We request you to kindly read the documentation again to avoid such misunderstandings and loss of time.

In your above example:
Code: Select all  Expand view  RUN

oQry:SetFilter( "A6 LIKE '%" + ALLTRIM( vGets[ 1 ] ) + "%'" )
oQry:GoTop()
XBROWSER oQry
 

DO NOT USE REQUERY()

OR, much better to use DBF syntax. We can also use parameterized filters.
Example:
Code: Select all  Expand view  RUN

oQry:SetFilter( "? $ UPPER(A6)", { Upper( AllTrim( vGets[ 1 ] ) ) } )
oQry:GoTop()
XBROWSER oQry
// later
oQry:Refilter( { "ABC" } )
oQry:GoTop()
XBROWSER oQry
 
Regards

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

Re: Ayuda con FILTER y MARIADB

Postby goosfancito » Wed Mar 16, 2022 10:52 am

muchas gracias!

Indicas que primero se use el SETFILTER y luego el REFILTER, como es el método para saber si ya se usó el SETFILTER primero?

a esto me refiero:
if (::oQry:SETFILTER() != nil)
...


Gracias
FWH 21.02
Harbour 3.2.0dev (r2104281802)
Copyright (c) 1999-2021, https://harbour.github.io/
User avatar
goosfancito
 
Posts: 1954
Joined: Fri Oct 07, 2005 7:08 pm

Re: Ayuda con FILTER y MARIADB

Postby nageswaragunupudi » Wed Mar 16, 2022 12:24 pm

You are the programmer. You know if you previously used oRs:SetFilter() and what parameters you used for this filter, if any.

Anyway
oQry:Filter --> present filter expression
oQry:aFiltParams --> array of parameters used, if any
Regards

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

Re: Ayuda con FILTER y MARIADB

Postby Armando » Wed Mar 16, 2022 4:32 pm

Goos:

Tal vez te puede ayudar a re abrir la tabla con la cláusula WHERE

Saludos
SOI, s.a. de c.v.
estbucarm@gmail.com
http://www.soisa.mex.tl/
http://sqlcmd.blogspot.com/
Tel. (722) 174 44 45
Carpe diem quam minimum credula postero
User avatar
Armando
 
Posts: 3229
Joined: Fri Oct 07, 2005 8:20 pm
Location: Toluca, México

Re: Ayuda con FILTER y MARIADB

Postby goosfancito » Wed Mar 16, 2022 6:26 pm

Armando wrote:Goos:

Tal vez te puede ayudar a re abrir la tabla con la cláusula WHERE

Saludos


Hola.
Ya Willi me dio una mano y me di cuenta el error que cometía (REQUERY) despues de aplicar el FILTER no tuve que modificar nada mas de mi codigo, solo comentar el REQUERY()

Gracias a todos!
FWH 21.02
Harbour 3.2.0dev (r2104281802)
Copyright (c) 1999-2021, https://harbour.github.io/
User avatar
goosfancito
 
Posts: 1954
Joined: Fri Oct 07, 2005 7:08 pm

Previous

Return to FiveWin para Harbour/xHarbour

Who is online

Users browsing this forum: D.Fernandez, Google [Bot], Lailton, sysctrl2 and 49 guests