Error "the data content could not be loaded" when trying to use SQL query in Base

It’s my first time using base. (or any other database)
I’ve created a database called Users, that has a single table called Table2. I realised I entered some dates incorrectly, so I want to do a “Find and Replace”.
I created a query in the Query design window:

UPDATE Table2
SET expiry_date = '2024-07-01'
WHERE expiry_date = '2024-06-01';

When I ran it using Run Query(F5) I get the following error message:

The data content could not be loaded. at C:/cygwin64/home/buildslave/source/libo-core/connectivity/source/commontools/dbtools.cxx:744

Table not found in statement [UPDATE Table2
SET expiry_date = ‘2024-07-01’
WHERE expiry_date = ‘2024-06-01’;
] at C:/cygwin64/home/buildslave/source/libo-core/connectivity/source/drivers

I’ve been googling for hours, but haven’t come up with anything useful (to me) except that it’s maybe something to do with the connection to the database.

When I load the database, I select “Open an existing database file”

Base was installed this morning, including java (which I’ve checked). It’s a completely vanilla installation as far as I can tell. I’m running windows.
Version: 24.2.3.2 (X86_64) / LibreOffice Community
Build ID: 433d9c2ded56988e8a90e6b2e771ee4e6a5ab2ba
CPU threads: 12; OS: Windows 10.0 Build 22631; UI render: Skia/Vulkan; VCL: win
Locale: en-NZ (en_NZ); UI: en-US
Calc: CL threaded

Can anyone help?
Are there any troubleshooting steps I can do?
(In my query I’m not sure if Table2 should be in quotes - I’ve tried double, single and none)
Also in my table the dates look like DD/MM/YY - not sure if that matters (they are formatted as dates, not text)

Tablenames and fieldnames should be quoted. There is a difference between upper cased and lower cased characters.

UPDATE "Table2"
SET "expiry_date" = '2024-07-01'
WHERE "expiry_date" = '2024-06-01';

Thank you, I tried that, and the first part of the error is the same: The data content could not be loaded. at C:/cygwin64/home/buildslave/source/libo-core/connectivity/source/commontools/dbtools.cxx:744

The second part now says: Statement does not generate a result set at C:/cygwin64/home/buildslave/source/libo-core/connectivity/source/drivers/jdbc/Object.cxx:172:

Seems you are using the query editor for this. SQL-code is an UPDATE, not SELECT. So execute it through
Tools → SQL.

1 Like

You could send every SQL-code through Tools → SQL to the database. But you can’t create a database this way.
So no problem to create a table, to insert values, to update values. All is possible in Tools → SQL.

If you are using query editor, you only could create queries.

Try this in SQL:

CREATE TABLE "Test" ("ID" INT PRIMARY KEY, "Text" VARCHAR(50));

Execute the code.
Go to View → Refresh Tables
… and then have a look: The table has been created.

Ok Robert, your statement works. Date format in the statement has to be yyyy-mm-dd even if the table shows dd/mm/yy.

The table shows DD/MM/YY, MM/DD/YY, DD.MM.YY, YY-MM-DD or any of dozens other variations depending on the office locale. YYYY-MM-DD is the world wide ISO standard. Every SQL dialect and most programming languages inerprete 1999-12-31 as the same date.
iso_8601

1 Like