The way Access/ODBC does updates to records

From: Davide Romanini <romaz(at)libero(dot)it>
To: pgsql-odbc(at)postgresql(dot)org
Subject: The way Access/ODBC does updates to records
Date: 2003-03-17 19:16:00
Message-ID: 3E761EF0.40901@libero.it
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-odbc

Hi,

When I link postgreSQL tables to access, and try to modify a record, I
found that odbc sends a query to postgresql containing a lot of fields
in the WHERE clause. For example:

I have a table names with fields id, name, surname, address.
When I modify an existing record changing the name from Davide to
Daniele, I expect that odbc sends a query like this:
UPDATE names SET name='Daniele' WHERE id=1;
or, in the case it looks for contamporary changes:
UPDATE names SET name='Daniele' WHERE id=1 AND name='Davide';

Instead I see it uses:
UPDATE names SET name='Daniele' WHERE id=1 AND name='Davide' AND
surname='Romanini' AND address='My address';

It wouldn't be a problem, but with some datatypes (dates, doubles for
example) and sometimes with triggers that change data before updates,
it has problems like the "Another user is changing the same data".

I want to know if there's a way to force access (or odbc) to use only
primary key fields in the WHERE clause for un UPDATE (there aren't
reasons to use other fields).

Thanks, Romaz
--
Davide Romanini

Browse pgsql-odbc by date

  From Date Subject
Next Message dziekan 2003-03-18 09:36:31 ODBC Level
Previous Message Adrian Klaver 2003-03-17 13:46:59 psqlODBC&unixODBC