Skip site navigation (1) Skip section navigation (2)

Peripheral Links

Header And Logo

PostgreSQL
| The world's most advanced open source database.

Site Navigation

Search for
  Advanced Search

Update-able View linked to Access



I created an updateable view using a two part rule and linked it as a table to MS Access.  I am
getting the error below when ever I try to update the name field.  I tried manually updating the
view from an access update query using only "ID" and it worked perfectly.  When I linked the view
as a table I defined id as the primary key, so why is the query sent by the ODBC driver using the
other fields as well when "ID" should be all that it needs?.

I could add these additional fields to the rules update where conditions, but if it works should
it even be necessary?

ERROR Message:

BEGIN;UPDATE "public"."vhusband" SET "name"=E'hell2'  WHERE "id" = 14 AND "name" = E'hello3' AND
"tiesize" = 12
ROLLBACK

It seems my rules are working outside the odbc transaction.

Update portion of Rule Definition:

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
)
;

Thanks for any help.

Regards,

Richard Broersma Jr.



Home | Main Index | Thread Index

Privacy Policy | PostgreSQL Archives hosted by Command Prompt, Inc. | Designed by tinysofa
Copyright © 1996 – 2008 PostgreSQL Global Development Group