Looking for information on how to create and use a form where the source is a view of a table.
The view is created via: 'CREATE VIEW "vTable" AS SELECT * FROM "tTable"'.
According to the Guide for 2.4.1, pg. 52, Views, a view of a table can be updatable, if created via i.e. the above statement.
Using a TRIGGERA view that is not updatable according to the above paragraph can be made updatable or insertable-into by adding INSTEAD OF triggers to the view.
Code: Select all
CREATE TRIGGER "triggerMail"
INSTEAD OF INSERT ON "viewMail"
REFERENCING NEW AS newrow FOR EACH ROW
MERGE INTO "tMail"
USING
(
VALUES
(
IDENTITY(),
newrow."FKTypeOfEmailPhoneFaxID",
newrow."FKPersonID",
newrow."FKEmployeeID",
newrow."Mail",
FALSE
)
) AS vals
(
u,
v,
w,
x,
y,
z
) ON "tMail"."Mail" = vals.y
WHEN MATCHED
THEN UPDATE SET "tMail"."Check" = TRUE
WHEN NOT MATCHED
THEN INSERT VALUES
vals.u,
vals.v,
vals.w,
vals.x,
vals.y,
vals.z
However, the form created from "viewMail", via the standard route, is not updatable.
I know I am missing something, but I do not know what.
Any suggestions,
Dream
Update: 05/04/2019. Started new thread, based on new insights