Update rule on multiple tables fails?

Поиск
Список
Период
Сортировка
Искать

Update rule on multiple tables fails?

От:
"w fm3" <wfm3@hotmail.com>
Дата:
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

FAQ