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

I disagree. Why would one limit what SQL code the query editor can generate, just because of an academic position. The only reason I believe MS Access survives in the market is because it makes creating queries possible for people that understand their dataset, but not necessarily the finer nuances of creating a SQL query. Whether one creates a SELECT query or an INSERT query from the results is trivial. The same goes for creating a DELETE query from a SELECT. Of course these can potentially delete or modify data in a database. Many people want to do exactly that, but without easy to use tools, they turn to a spreadsheet instead or some other awkward method.

I believe that LibreOffice can be the definitive standard for ease of use (compared to the convoluted and random way in which MS Office has devolved), but to be that there are some missing parts that are really needed.

This is not what I mean. Of course Base does these database actions. I’m referring to a query editor that can create INSERT, UPDATE and DELETE queries.

There is no FOSS database tool (and hardly any non-FOSS either) that can do this easily and properly, except MS Access. Were I a software dev, it would be very high on my list of priorities to create such a tool.

Yes, my opinion is subjective, that is the nature of an opinion.

Can we start a bounty to get some devs to team to to build this? The bulk of the work is done, it really just needs expansion.

I know that this is not what you mean. Just wanted to help with a way to store an action query in a push button.
If you really need a query designer for complex queries, you can use the built-in query designer to select all primary keys for the action, like this: SELECT "ID" FROM "table" JOIN "other_table" ON "table"."XID" = "other_table"."ID" WHERE ... lots of complex conditions.
Right-click>Save query as view.
Then all you need to run is DELETE FROM "table" WHERE "ID" IN (SELECT "ID" FROM "your_view_name").

Yea, I use that more or less so. This is why my contention is that we’re pretty close to being able to create the whole thing in the GUI editor. It’s not a massive enhancement to add the full SQL statement generation capability to the tool, but it will sure make life a lot easier for all those that need to use this from time time where it’s not their primary function (ie, non-DBA’s)

You may be interested in QBE.