Como llenar un campo sin recorrer toda la tabla MariaDB igual a un REPLACE ALL de DBF
De ésta forma tarda:
Code: Select all
oSQL:Gotop()
Do While !oSQL:Eof()
oSQL:EXT:='123';oSQL:Save() //oSQL:Update()
oSQL:Skip()
Enddo
Code: Select all
oSQL:Gotop()
Do While !oSQL:Eof()
oSQL:EXT:='123';oSQL:Save() //oSQL:Update()
oSQL:Skip()
Enddo
Code: Select all
oServer:Execute("UPDATE mitabla SET ext = '123'")
Code: Select all
oCn:Execute("UPDATE mitabla SET ext = '123'")
oRs:Requery()
oBrw:Refresh()
Code: Select all
oSQL:Seek(cNom)
If oSQL:Eof()
?"Append" <-Do not enter
oSQL:Append();oSQL:NOMBRE:=cNom;oSQL:EXT:=cExt;oSQL:TAMANO:=nTam;oSQL:TIPO:=cTipo;oSQL:POSTER:="";oSQL:UBICACION:=ZpDir
Else
oSQL:NOMBRE:=cNom;oSQL:EXT:=cExt;oSQL:TAMANO:=nTam;oSQL:TIPO:=cTipo;oSQL:UBICACION:=ZpDir
Endif
Code: Select all
if oSql:Seek( cNom )
oSql:Update( "EXT,TAMANO,TIPO,UBIACTION", { cExt, nTam, cTipo, ZpDir } )
else
oSql:Append( "NOMBRE,EXT,TAMANO,TIPO,POSTER,UBIACTION", ;
{ cNom, cExt, nTam, cTipo, "", ZpDir } )
endif
Code: Select all
oSQL:Gotop()
Do While !oSQL:Eof()
If Empty(oSQL:DURACION) .And. Empty(oSQL:POSTER) )
oSQL:Delete()
Endif
oSQL:Skip()
Enddo
//I tried like this
oCn:Execute("DELETE "+cTABLA+" WHERE Empty(DURACION) And Empty(POSTER)") //but it does not work
please try first in heidisql or other frontendoCn:Execute("DELETE FROM "+cTABLA+" WHERE LENGTH(DURACION)=0 And LENGTH(POSTER)=0")
or
oCn:Execute("DELETE FROM "+cTABLA+" WHERE DURACION='' And POSTER='' ")
Code: Select all
DELETE FROM <table> WHERE ( DURATION IS NULL OR DURATION = '' ) AND ( POSTER IS NULL OR POSTER = '' )
Code: Select all
DELETE FROM <table> WHERE ( DURATION IS NULL OR DURATION = '' ) AND ( POSTER IS NULL OR POSTER = '' )
Code: Select all
DELETE FROM <table> WHERE COALESCE(DURATION,'') = '' AND COALESCE(POSTER,'') = ''