Macros/Base/ba002

From The Document Foundation Wiki
< Macros‎ | Base
Jump to navigation Jump to search
Other languages:
English

Description

Execute update in current database

Basic code

 1Sub main()
 2    doc = ThisComponent
 3    conn = doc.DataSource.getConnection("", "")
 4
 5    sql = "UPDATE ""contactos"" SET ""numbers""=TRIM(""numbers"")"
 6    cursor = conn.prepareStatement(sql)
 7    result = cursor.executeUpdate()
 8    doc.store()
 9    MsgBox result
10End Sub