pg.ddx.io  pgsql-odbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: lutz.willerding@gmail.com
To: pgsql-odbc@postgresql.org
Subject: updatable views and MS-Access 2K
Date: 5 Nov 2004 15:44:51 -0800
Message-ID: <eb4b01ed.0411051544.3b33158c@posting.google.com> (raw)

how do you do it?

looking for a solution, I found this thread just some lines below:
update rules + views + ....
which suggests using ctid, causing problems with views using more than
1 table.
for views using 2 tables, I found the following partial solution:

1: updatable views need a 'catch all rule'; docs indicate to do
something like:
'create or replace rule UpdRuleCatchAll as on update myview do instead
nothing;'

It looks like, this 'nothing' makes access moan about 'no record'.
'do nothing' replaced by:
'do select * from myview where <YourPrimaryKeySpecHere>'
returns 1(!) record. -> no 'record missing' any more.


2: do specific update rules with '...where OLD.YourKey is NULL or
OLD.yourkey <> NEW.yourkey (update or insert the table involved) where
(use exactly the same keys as you will give access as the primary
key(s) when importing the view as a linked table)

didn't try to do insert or delete rules yet; using a form, I just call
a stored procedure on a 'OnClick'-Event that is designed to do what is
needed, and the .Requery of the matching MS-Access-Object.

This works _without_ including ctid in the views definition _and_ it
works with 2 tables involved. (just trying to get the third)



Message-ID: <eb4b01ed.0411051544.3b33158c@posting.google.com>
Permalink:  ../eb4b01ed.0411051544.3b33158c@posting.google.com/
Also on:    postgresql.org/message-id/eb4b01ed.0411051544.3b33158c@posting.google.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-odbc@postgresql.org
  Cc: lutz.willerding@gmail.com
  Subject: Re: updatable views and MS-Access 2K
  In-Reply-To: <eb4b01ed.0411051544.3b33158c@posting.google.com>
  References: <eb4b01ed.0411051544.3b33158c@posting.google.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox