Macros/Base/ba002
TDF LibreOffice Document Liberation Project Blog comunitari Weblate Nextcloud Redmine Ask LibreOffice Donazione
Descrizione
Esegue un aggiornamento nel database corrente
Sub main()
doc = ThisComponent
conn = doc.DataSource.getConnection("", "")
</div>
<div lang="en" dir="ltr" class="mw-content-ltr">
sql = "UPDATE ""contactos"" SET ""numbers""=TRIM(""numbers"")"
cursor = conn.prepareStatement(sql)
result = cursor.executeUpdate()
doc.store()
MsgBox result
End Sub
def main():
doc = XSCRIPTCONTEXT.getDocument()
conn = doc.DataSource.getConnection('', '')
</div>
<div lang="en" dir="ltr" class="mw-content-ltr">
sql = 'UPDATE "contactos" SET "numbers"=TRIM("numbers")'
cursor = conn.prepareStatement(sql)
result = cursor.executeUpdate()
doc.store()
print(result) # silent if Python console is absent
return