a ver con esta aRow := oCon:QueryResult( "SELECT " + cList +

Post Reply
D.Fernandez
Posts: 392
Joined: Wed Jul 31, 2013 1:14 pm
Location: Maldonado - Uruguay
Contact:

a ver con esta aRow := oCon:QueryResult( "SELECT " + cList +

Post by D.Fernandez »

Amigos como hago un select con la clausula where?
cPass:= 3074


FWCONNECT oCon HOST chost USER cUser PASSWORD cPass DB dbases


cList := "NOMLARGO,IDUSU,PASAR,CLAVELIQ"
aRow := oCon:QueryResult( "SELECT " + cList + " FROM USUARIO WHERE IDUSU = cPass " )

No le pongo la clausula where y funciona.



Gracias.
Dario Fernandez
FWH, Harbour, BCC, MySql & MariaDB, tData, Dbf/Cdx
VSCode.
Maldonado - Uruguay
artu01
Posts: 306
Joined: Fri May 11, 2007 8:20 pm
Location: Lima

Re: a ver con esta aRow := oCon:QueryResult( "SELECT " + cList +

Post by artu01 »

D.Fernandez wrote:Amigos como hago un select con la clausula where?
cPass:= 3074


FWCONNECT oCon HOST chost USER cUser PASSWORD cPass DB dbases


cList := "NOMLARGO,IDUSU,PASAR,CLAVELIQ"
aRow := oCon:QueryResult( "SELECT " + cList + " FROM USUARIO WHERE IDUSU = cPass " )

No le pongo la clausula where y funciona.



Gracias.

Code: Select all

aRow := oCon:QueryResult( "SELECT " + cList + " FROM USUARIO WHERE IDUSU = ' "+ cPass+" ' " )
 
fwh 17.12, harbour 3.2.0, pelles C, bcc7, Ms-Sql
artu01
Posts: 306
Joined: Fri May 11, 2007 8:20 pm
Location: Lima

Re: a ver con esta aRow := oCon:QueryResult( "SELECT " + cList +

Post by artu01 »

Si tu tipo de dato del campo IDUSU es char

Code: Select all

aRow := oCon:QueryResult( "SELECT " + cList + " FROM USUARIO WHERE IDUSU = ' "+ cPass+" ' " )
 
Si es numerico

Code: Select all

aRow := oCon:QueryResult( "SELECT " + cList + " FROM USUARIO WHERE IDUSU = "+ str(cPass,4) )
 
fwh 17.12, harbour 3.2.0, pelles C, bcc7, Ms-Sql
D.Fernandez
Posts: 392
Joined: Wed Jul 31, 2013 1:14 pm
Location: Maldonado - Uruguay
Contact:

Re: a ver con esta aRow := oCon:QueryResult( "SELECT " + cList +

Post by D.Fernandez »

Gracias, la verdad no entiendo que me pasa.

Me abre un archivo ZUSU.ADT Increible pero cierto.

Si le saco el WHERE abre la tabla suario.sql.

Saludos.
Dario Fernandez
FWH, Harbour, BCC, MySql & MariaDB, tData, Dbf/Cdx
VSCode.
Maldonado - Uruguay
Post Reply