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

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

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

Post by D.Fernandez »

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, Harbour, BCC, MySql & MariaDB, tData, Dbf/Cdx
VSCode.
Maldonado - Uruguay
User avatar
nageswaragunupudi
Posts: 8017
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Contact:

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

Post by nageswaragunupudi »

Code: Select all

oCon:Update( "clientes", { "nomcli" }, { nom }, { { "numercli", cCod } } ) --> Number of rows updated
If you want to see the SQL statement built

Code: Select all

cSql := oCon:UpdateSQL( "clientes", { "nomcli" }, { nom }, { { "numercli", cCod } } )
? cSql
 
Result:

Code: Select all

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

"`numercli` = '" + cCod + "'"
 
but specifying as an array may be more convenient.
Regards

G. N. Rao.
Hyderabad, India
rubenfernandez01
Posts: 23
Joined: Sun Sep 20, 2015 1:41 am

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

Post by rubenfernandez01 »

Thanks a lot. I'm trying sql.

Diario Fernández,.

Enviado desde mi Redmi Note 8 Pro mediante Tapatalk
Post Reply