Ayuda con FILTER y MARIADB

User avatar
nageswaragunupudi
Posts: 10733
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Been thanked: 11 times
Contact:

Re: Ayuda con FILTER y MARIADB

Post by nageswaragunupudi »

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


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


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
goosfancito
Posts: 1956
Joined: Fri Oct 07, 2005 7:08 pm

Re: Ayuda con FILTER y MARIADB

Post by goosfancito »

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
nageswaragunupudi
Posts: 10733
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Been thanked: 11 times
Contact:

Re: Ayuda con FILTER y MARIADB

Post by nageswaragunupudi »

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
Armando
Posts: 3279
Joined: Fri Oct 07, 2005 8:20 pm
Location: Toluca, México
Been thanked: 4 times
Contact:

Re: Ayuda con FILTER y MARIADB

Post by Armando »

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
goosfancito
Posts: 1956
Joined: Fri Oct 07, 2005 7:08 pm

Re: Ayuda con FILTER y MARIADB

Post by goosfancito »

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/
Post Reply