Update eb MariaDB por el lugar

Update eb MariaDB por el lugar

Postby D.Fernandez » Thu Jul 13, 2023 8:07 pm

Amigos : Tengo que hacer un UPDATE en MariaDB pero no se el nombre del campo, si se el lugar en que se encuenta.



cSql4 := oCon4:UpdateSQL( 'saldos', {....... 'mes1', 'mes2', 'mes3','mes4,..................'mes12' }, { QUIERO ACTUAZAR MES3 Y MES4 }, { { 'id', numero } } )
oCon4:Execute(cSql4)
oRs4:Requery()

Muchas gracias
Saludos.
Ruben Dario Fernandez
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: Update eb MariaDB por el lugar

Postby horacio » Thu Jul 13, 2023 11:44 pm

Hola, la solución que uso es

Code: Select all  Expand view

cUpdate := 'Update saldos set mes3 = "ESTO ES EL MES TRES", mes4  = "ESTO ES EL MES CUATRO" where ....'
oCon : Execute( cUpdate )
 


Espero te sirva

Saludos
horacio
 
Posts: 1358
Joined: Wed Jun 21, 2006 12:39 am
Location: Capital Federal Argentina

Re: Update eb MariaDB por el lugar

Postby nageswaragunupudi » Sun Jul 16, 2023 10:54 pm

Instead of cSql4 := oCon4:UpdateSQL(...) and then oCn4:Execute( cSql4 ), we can
Code: Select all  Expand view

oCon4:Update( "balances", "month3,month4", { "MAR", "APR" }, { "ID", number } )
oRs4:ReQuery()
 


We can further simplify this:
Code: Select all  Expand view

oRs4:Update( "month3,month4", { "MAR", "APR" } )
// oRs4:Requery() is not required. Waste of time
 
Regards

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

Re: Update eb MariaDB por el lugar

Postby rubenfernandez01 » Fri Jul 21, 2023 9:56 pm

Excelente Mr. Rao. I
Thank you very much.

Best regards Ruben Dario Fernandez.

Enviado desde mi 21081111RG mediante Tapatalk
rubenfernandez01
 
Posts: 46
Joined: Sun Sep 20, 2015 1:41 am


Return to FiveWin para Harbour/xHarbour

Who is online

Users browsing this forum: Antonio Linares, cmsoft, Google [Bot], JoseAlvarez and 77 guests