Page 1 of 1

tDolphin :: Cambiar where de un query en tiempo de ejecucion

Posted: Tue Mar 15, 2011 12:15 am
by pablovidal
Saludos,

Eso mismo, necesito cambiar el where de un query en tiempo de ejecucion.-

Code: Select all

 o:= oMysql:Query( "select numeros, vendido, (vendido*precio) as total from doctempo where pestana='1' and loteria='2'" ) 
 o:cWhere := "pestana ='2' and loteria = '4'"
 

Re: tDolphin :: Cambiar where de un query en tiempo de ejecucion

Posted: Tue Mar 15, 2011 12:23 am
by Daniel Garcia-Gil
Pablo...

y cual es el problema que te genera?

Re: tDolphin :: Cambiar where de un query en tiempo de ejecucion

Posted: Tue Mar 15, 2011 12:46 am
by pablovidal
Daniel no me asume el nuevo where

Re: tDolphin :: Cambiar where de un query en tiempo de ejecucion

Posted: Tue Mar 15, 2011 5:10 pm
by nnicanor
Hola,

debes hacer un refresh para que te refresque el query y aplique el nuevo where

Slds

NMM

Re: tDolphin :: Cambiar where de un query en tiempo de ejecucion

Posted: Tue Mar 15, 2011 5:17 pm
by pablovidal

Code: Select all

 oQuery := oMysql:Query( "select * from presidentes where nombre='JUAN DE LOS PALOTES'" )
 oQuery:SetWhere( "nombre='TUNOMBRE'" )
 oQuery:Refresh()
 

Re: tDolphin :: Cambiar where de un query en tiempo de ejecucion

Posted: Tue Mar 15, 2011 5:20 pm
by Daniel Garcia-Gil
Pablo

Tambien puedes hacer

Code: Select all

oQuery:SetWhere( "nombre='TUNOMBRE'", .T. )
el segundo parametro envia un valor logico para refrescar el query

tomado desde la clase

Code: Select all

METHOD SetWhere( cWhere, lRefresh )   INLINE ::SetNewFilter( SET_WHERE, cWhere, lRefresh )

Re: tDolphin :: Cambiar where de un query en tiempo de ejecucion

Posted: Tue Mar 15, 2011 6:37 pm
by pablovidal
Gracias Daniel :)

Recuerdate del asunto aquel

Re: tDolphin :: Cambiar where de un query en tiempo de ejecucion

Posted: Wed Mar 16, 2011 1:38 am
by Daniel Garcia-Gil
Pablo...

no te he visto conectado... enviame una forma de como comunicarme contigo

Gracias

Re: tDolphin :: Cambiar where de un query en tiempo de ejecucion

Posted: Wed Mar 16, 2011 2:12 am
by pablovidal
enviame un mail a: pabloalbertovidal arroba gmail punto com