Support for UPDATE, DELETE, INSERT queries

The sad reality still in 2025 is that there is not one single DBM product that runs natively on Linux that sports a graphical query editor that comes even close to what Microsoft Access offers.

Are there any plans to expand Base to support more than SELECT queries?

When you insert a new record, Base runs an INSERT statement.
When you save an edited record, Base runs an UPDATE statement.
When you delete a record or more than one, Base runs a DELETE statement.

Contrary to all that, a SELECT statement does not modify records. This is why Access distinguishes between “queries” and “action queries”.

There are so many open bugs in Base and only some developers, who try to fix these bugs. I don’t see a developer adding new features to Base at this moment.

The query editor is a tool for creating queries, not for changing content by a SQL command. This should be done through Tools → SQL or by macro.

Bug for this is very old: 31398 – RFE: LibreOffice Base should allow update/insert/drop query in sql-editor with hsqldb access controls

A simple macro with “debug mode” to be called from a push button on a form.

  1. Write one or more SQL statements, separated by semicolon, into a text editor.
  2. Create a push button and copy the statement(s) to the “Additional info” property of your push button.
  3. Assign the execute event to the following macro.
  4. Set Const cMsgbox = True in order to show a message box that allows you to cancel the SQL execution. If you are sure that you want to execute silently, set Const cMsgbox = False

After executing the SQL statement(s), the macro reloads the form it is attached to.

Sub RunSQLButton(e)
Const cMsgbox = True
Const cMaxLen = 1000
Const cTitle = "Command "
oModel = e.Source.Model
frm = oModel.getParent()
oCon = frm.ActiveConnection
aTags() = split(oModel.Tag, ";")
n = uBound(aTags)
for i = 0 to n
	s = trim(aTags(i))
	sMsg = s
	if len(s) > cMaxLen then sMsg = Left(s, cMaxLen) & Chr(10) &" [...]"
	if len(s)>0 and cMsgbox then 
		x = Msgbox(sMsg, 33, cTitle &  i +1 &"/"& n +1 )
	else
		x = 1
	end if
	if x = 1 then
		oStmt = oCon.prepareStatement(s)
		on error goto errMsg
			r = oStmt.executeUpdate()
		if cMsgbox then Msgbox r &" records affected", 64, cTitle
	end if
next
frm.reload()
exit sub
errMsg:
error(err)
End Sub
1 Like