csql := oCon:UPDATE( "clientes" , SOLUCIONADO

csql := oCon:UPDATE( "clientes" , SOLUCIONADO

Postby D.Fernandez » Mon Aug 31, 2020 3:22 am

Hola, alguien me podria ayudar con esta sintaxsis por favor.


cCod := "2001"
nom := "Dario"
numercli es el numero del cliente

csql := oCon:UPDATE( "clientes" , "nomcli", nom , WHERE numercli = cCod )

Gracias, no le doy en la tecla y no encontré ningún ejemplo.

Saludos

Dario Fernandez
Last edited by D.Fernandez on Mon Aug 31, 2020 3:30 pm, edited 1 time in total.
Dario Fernandez
FWH 22.12, Harbour, MVS2022 Community, BCC, MySql & MariaDB, Dbf/Cdx VSCode.
Maldonado - Uruguay
D.Fernandez
 
Posts: 455
Joined: Wed Jul 31, 2013 1:14 pm
Location: Maldonado - Uruguay

Re: csql := oCon:UPDATE( "clientes" , "nomcli", nom , ...

Postby nageswaragunupudi » Mon Aug 31, 2020 4:03 am

Code: Select all  Expand view
oCon:Update( "clientes", { "nomcli" }, { nom }, { { "numercli", cCod } } ) --> Number of rows updated


If you want to see the SQL statement built
Code: Select all  Expand view
cSql := oCon:UpdateSQL( "clientes", { "nomcli" }, { nom }, { { "numercli", cCod } } )
? cSql
 


Result:
Code: Select all  Expand view
UPDATE `clientes` SET `nomcli` = 'Dario' WHERE `numercli` = '2001'


Second parameter is an array of fieldnames or list of fieldnames.
Third parameter is an array of values.
Fourth parameter can be
1) an multi-dim array of fieldnames and values.
2) Literal where condition.

In the above example, the fourth parameter can also be:
Code: Select all  Expand view

"`numercli` = '" + cCod + "'"
 

but specifying as an array may be more convenient.
Regards

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

Re: csql := oCon:UPDATE( "clientes" , "nomcli", nom , ...

Postby rubenfernandez01 » Mon Aug 31, 2020 4:06 am

Thanks a lot. I'm trying sql.

Diario Fernández,.

Enviado desde mi Redmi Note 8 Pro mediante Tapatalk
rubenfernandez01
 
Posts: 46
Joined: Sun Sep 20, 2015 1:41 am


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 41 guests