I’m trying to update multiple records in a Libreoffice Base database I use to keep track of many electronic equipment items.
The database includes a “Devices” table as well as an “Incidents” table in which I can record historical events related to individual devices, (returned, repaired, discarded etc.)
I would like to insert records in the “Incidents” table on multiple, (but not all) records without individually entering info for each item in my form.
I have searched and found some ideas for how to accomplish the task and have come up with the following SQL statement to achieve the task:
INSERT INTO “Incidents”
(
“Device”,
“Incident Date”,
“Incident Description”
)
VALUES
(
SELECT
“Serial Number”
FROM
“Devices”
WHERE
“Devices”.“Location” = 5,
‘2024-02-21’,
‘(text describing an change of location incident for multiple devices)’
)
However, this returns an error: “1: Single value expected” when executed
The following does execute without error and adds a single record when tested:
INSERT INTO “Incidents”
(
“Device”,
“Incident Date”,
“Incident Description”
)
VALUES
(
‘012570’,
‘2024-02-21’,
‘(text describing an change of location incident for multiple devices)’
)
Do I have a syntax issue here, or am I going about the task incorrectly?
Any help would be greatly appreciated and thank-you in advance.