Re: Update-able View linked to Access
От | Richard Broersma Jr |
---|---|
Тема | Re: Update-able View linked to Access |
Дата | |
Msg-id | 938243.53161.qm@web31814.mail.mud.yahoo.com обсуждение исходный текст |
Ответ на | Re: Update-able View linked to Access (Hiroshi Inoue <inoue@tpf.co.jp>) |
Ответы |
Re: Update-able View linked to Access
|
Список | pgsql-odbc |
> Could you try the following ? > Add the CTID field of the target table of the last update rule to the > definition of the view. In your case, try to add husband.ctid to the > definition of vhusband. I am still getting similar errors, only now both columns are locked. Here is my new view definition: -------------------------------- CREATE OR REPLACE VIEW public.vhusband (id, personctid, husbandctid, name, tiesize) AS SELECT A.id, A.ctid, B.ctid, A.name, B.tiesize FROM public.person as A INNER JOIN public.husband as B ON A.id = B.ID ; using OLD.husbandctid ------------------------------------ BEGIN;UPDATE "public"."vhusband" SET "tiesize"=3 WHERE "id" = 14 AND "personctid" = E'(0,63)' AND "husbandctid" = E'(0,42)' AND "name" = E'hel0' AND "tiesize" = 3 ROLLBACK ------------------------------------ Here is my new update rule: CREATE OR REPLACE RULE vhusband_update_person AS ON UPDATE TO public.vhusband DO INSTEAD ( UPDATE public.person SET name = NEW.name WHERE id = OLD.id; UPDATE public.husband SET tiesize = NEW.tiesize WHERE id = OLD.id AND ctid = OLD.husbandctid ) ; using NEW.husbandctid --------------------------- BEGIN; UPDATE "public"."vhusband" SET "name"=E'4' WHERE "id" = 14 AND "personctid" = E'(0,63)' AND "husbandctid" = E'(0,42)' AND "name" = E'hel0' AND "tiesize" = 3 ROLLBACK ---------------------------- CREATE OR REPLACE RULE vhusband_update_person AS ON UPDATE TO public.vhusband DO INSTEAD ( UPDATE public.person SET name = NEW.name WHERE id = OLD.id; UPDATE public.husband SET tiesize = NEW.tiesize WHERE id = OLD.id AND ctid = new.husbandctid ) ; Thanks for the help. Regards, Richard Broersma Jr.
В списке pgsql-odbc по дате отправления: