Subject | Re: [IB-Architect] Updatable views |
---|---|
Author | Ivan Prenosil |
Post date | 2001-12-04T00:08:11Z |
Jason, I think I understand you now. Basically we are suggesting the same
thing (just little different syntax). Correct me if I am wrong here:
CREATE TABLE tab (...);
CREATE VIEW v (...) FOR SELECT, INSERT AS
SELECT * FROM tab;
CREATE TRIGGER tr FOR v BEFORE UPDATE AS ...
This command
INSERT INTO v ...
will insert values directly into tab.
This command
UPDATE v SET ...
will fire trigger tr, but does not update table tab directly.
This command
DELETE FROM v ...
will cause error because the view does not have allowed deletes,
and there is no trigger to take over the job.
Ivan
thing (just little different syntax). Correct me if I am wrong here:
CREATE TABLE tab (...);
CREATE VIEW v (...) FOR SELECT, INSERT AS
SELECT * FROM tab;
CREATE TRIGGER tr FOR v BEFORE UPDATE AS ...
This command
INSERT INTO v ...
will insert values directly into tab.
This command
UPDATE v SET ...
will fire trigger tr, but does not update table tab directly.
This command
DELETE FROM v ...
will cause error because the view does not have allowed deletes,
and there is no trigger to take over the job.
Ivan