Hi all,
The docs seem slim in this department.. what is the proper syntax for an
update to a view with multiple tables?
Here's a view I'd like to update:
CREATE VIEW "users_perms_view" AS
SELECT
users.user_id,
users.username,
users.name_first,
users.name_last,
permissions.permission_name,
permissions.permission_description
FROM
users,
users_permissions,
permissions
WHERE
((users_permissions.user_id = users.user_id) AND
(users_permissions.permission_id = permissions.permission_id));
This rule works fine as far as it goes:
CREATE RULE "update_users_perms_view" AS
ON UPDATE TO users_perms_view DO INSTEAD
UPDATE
users SET
username = NEW.username,
password = NEW.password,
name_first = NEW.name_first,
name_last = NEW.name_last,
active = NEW.active,
WHERE
user_id = OLD.user_id;
How do I update the users_permissions and permissions table?
Thanx,