On Sun, Sep 17, 2006 at 02:32:10PM +0200, Joost Kraaijeveld wrote:
> For the contactaddress I also have a trigger(function) that should
> update the record in the third table with the additional info of the
> contactaddress:
>
> ....
> SELECT INTO customer_record objectid FROM prototype.customers WHERE contactaddress = NEW.objectid;
> IF customer_record.objectid IS NOT NULL THEN
> UPDATE customeraddress set zipcode = NEW.zipcode, city = NEW.city, housenumber = NEW.housenumber , address =
NEW.objectid
> WHERE customer = customer_record.objectid;
>
> This last trigger is executed but customer_record.objectid seems to be
> always NULL as if the the customer record is not visible. Is that
> correct or is there something wrong with the SQl above?
Where does prototype.customers fit in? Are you sure it has a row
that matches the WHERE clause? Where would that row have come from?
Is there a reason you're maintaining customeraddress as a materialized
view rather than as a "real" view?
--
Michael Fuhr