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

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

Postby D.Fernandez » Sat Nov 28, 2020 5:50 pm

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 24.09, Harbour, MVS2022 Community, BCC, MySql & MariaDB, Dbf/Cdx VSCode.
Maldonado - Uruguay
D.Fernandez
 
Posts: 474
Joined: Wed Jul 31, 2013 1:14 pm
Location: Maldonado - Uruguay

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

Postby artu01 » Sat Nov 28, 2020 6:04 pm

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  Expand view  RUN

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

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

Postby artu01 » Sat Nov 28, 2020 6:09 pm

Si tu tipo de dato del campo IDUSU es char
Code: Select all  Expand view  RUN

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


Si es numerico
Code: Select all  Expand view  RUN

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

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

Postby D.Fernandez » Sat Nov 28, 2020 6:37 pm

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 24.09, Harbour, MVS2022 Community, BCC, MySql & MariaDB, Dbf/Cdx VSCode.
Maldonado - Uruguay
D.Fernandez
 
Posts: 474
Joined: Wed Jul 31, 2013 1:14 pm
Location: Maldonado - Uruguay


Return to FiveWin para Harbour/xHarbour

Who is online

Users browsing this forum: checo176, Google [Bot] and 76 guests