Thread: Update rule on multiple tables fails?

Update rule on multiple tables fails?

From
"w fm3"
Date:
Hi

Could anyone let me know if I have  done something wrong with the rule? As
when trying to update via ODBC the update fails.

Postgresql 7.3.2

1 view, joining 2 tables
(1 - many, in this case- organisations and contacts- 'orgref' and 'conref'
being the Primary keys)

--
View definition looks like:

SELECT contacts.conref, contacts.orgref, contacts.lastname,
organisations.lob
FROM (contacts
LEFT JOIN  organisations  ON ((contacts.orgref = organisations.orgref )));

Rule looks like:..do instead...

UPDATE contacts SET lastname = new.lastname

WHERE (old.conref = contacts.conref ); UPDATE organisations SET lob =
new.lob
WHERE (old.orgref = organisations.orgref );  );

---

in this case trying to make changes to the lastname and lob fields.

Many thanks

_________________________________________________________________
Tired of spam? Get advanced junk mail protection with MSN 8.
http://join.msn.com/?page=features/junkmail