Page 1 of 1

Update eb MariaDB por el lugar

PostPosted: Thu Jul 13, 2023 8:07 pm
by D.Fernandez
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

Re: Update eb MariaDB por el lugar

PostPosted: Thu Jul 13, 2023 11:44 pm
by horacio
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

Re: Update eb MariaDB por el lugar

PostPosted: Sun Jul 16, 2023 10:54 pm
by nageswaragunupudi
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
 

Re: Update eb MariaDB por el lugar

PostPosted: Fri Jul 21, 2023 9:56 pm
by rubenfernandez01
Excelente Mr. Rao. I
Thank you very much.

Best regards Ruben Dario Fernandez.

Enviado desde mi 21081111RG mediante Tapatalk