FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour csql := oCon:UPDATE( "clientes" , SOLUCIONADO
Posts: 555
Joined: Wed Jul 31, 2013 01:14 PM
csql := oCon:UPDATE( "clientes" , SOLUCIONADO
Posted: Mon Aug 31, 2020 03: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

Dario Fernandez

FWH 2501, Harbour, MVS2022 Community, MySql & MariaDB, Dbf/Cdx VSCode.

Maldonado - Uruguay
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: csql := oCon:UPDATE( "clientes" , "nomcli", nom , ...
Posted: Mon Aug 31, 2020 04:03 AM
Code (fw): Select all Collapse
oCon:Update( "clientes", { "nomcli" }, { nom }, { { "numercli", cCod } } ) --> Number of rows updated


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


Result:
Code (fw): Select all Collapse
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 (fw): Select all Collapse
"`numercli` = '" + cCod + "'"

but specifying as an array may be more convenient.
Regards



G. N. Rao.

Hyderabad, India
Posts: 48
Joined: Sun Sep 20, 2015 01:41 AM
Re: csql := oCon:UPDATE( "clientes" , "nomcli", nom , ...
Posted: Mon Aug 31, 2020 04:06 AM

Thanks a lot. I'm trying sql.

Diario FernĂĄndez,.

Enviado desde mi Redmi Note 8 Pro mediante Tapatalk

Continue the discussion