Update rule on multiple tables fails? - Mailing list pgsql-novice

From w fm3
Subject Update rule on multiple tables fails?
Date
Msg-id BAY1-F1703Z4d5htAyD000014b8@hotmail.com
Whole thread Raw
List pgsql-novice
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


pgsql-novice by date:

Previous
From: Josh Berkus
Date:
Subject: Re: advice
Next
From: Tom Lane
Date:
Subject: Re: advice